From owner-freebsd-arch@FreeBSD.ORG Wed Jul 10 22:19:44 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D067496A for ; Wed, 10 Jul 2013 22:19:44 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 9B47E1EC5 for ; Wed, 10 Jul 2013 22:19:44 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 826CA58380 for ; Wed, 10 Jul 2013 16:51:03 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id ZPL1JzRiXLii for ; Wed, 10 Jul 2013 16:51:03 -0500 (CDT) Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu [172.16.223.97]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 6359D5837F for ; Wed, 10 Jul 2013 16:51:03 -0500 (CDT) Message-ID: <51DDD747.80206@freebsd.org> Date: Wed, 10 Jul 2013 16:51:03 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130627 Thunderbird/17.0.7 MIME-Version: 1.0 To: freebsd-arch@freebsd.org Subject: Re: Adding a MACHINE_ARCH note References: <32F979BD-FB5C-4111-9586-4C5E7C6DFA71@bsdimp.com> <20130710195547.GB68830@ithaqua.etoilebsd.net> <201307101611.37437.jhb@freebsd.org> <20130710212436.GF68830@ithaqua.etoilebsd.net> <20130710213115.GG68830@ithaqua.etoilebsd.net> In-Reply-To: <20130710213115.GG68830@ithaqua.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jul 2013 22:19:44 -0000 On 07/10/13 16:31, Baptiste Daroussin wrote: > On Wed, Jul 10, 2013 at 03:27:12PM -0600, Warner Losh wrote: >> On Jul 10, 2013, at 3:24 PM, Baptiste Daroussin wrote: >> >>> >>> You should look at how MACHINE_CPUARCH vs MACHINE vs MACHINE_ARCH works. >>> >>> Keep in mind that amd64/i386/pc98 should probably have MACHINE_CPUARCH of x86, >>> but we just haven't done that yet. If we did that I think you could follow >>> src's conventions and be fine. Something like: >>> >>> os:version:cpuarch:arch >>> >>> Where cpuarch == MACHINE_CPUARCH (should be x86 on amd64/i386/pc98, but isn't >>> yet. It ss sane on other platforms) and >>> arch == MACHINE_ARCH (amd64/i386 (for pc98 MACHINE_ARCH is i386)) >>> >>> So that would give: >>> >>> freebsd:9:x86:amd64 >>> freebsd:9:x86:i386 (for both pc98 and i386) >>> freebsd:9:arm:armv6 >>> >>> etc. >>> >>> I think that means we could eventually support x32 as: >>> >>> freebsd:9:x86:x32 >>> >>> We might have an x32 world (but perhaps not a kernel?, though we would need >>> the headers to DTRT) >>> I do like the idea a lot. >> We should add a flag to uname to get MACHINE_CPUARCH, and publish it as hw.cpu_arch in sysctl. >> > I will still have to workaround on older releases. The one without those > informations. > > regards, > Bapt On those systems, I think you can easily get away with assuming hw.abi == `uname -p`. Installing i386 packages on amd64 systems (or powerpc on powerpc64 or ...) will likely require some infrastructure work anyway and hw.abi is a perfect quick MFC candidate. A few quick special cases will solve any remaining problems almost universally. -Nathan