Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Feb 2010 16:34:48 -0600
From:      Nathan Whitehorn <nwhitehorn@freebsd.org>
To:        Warner Losh <imp@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   Re: svn commit: r203446 - in user/imp/tbemd: . bin/pax cddl/lib/libdtrace cddl/lib/libzpool contrib/smbfs etc games/morse gnu/lib/csu gnu/lib/libgcc gnu/lib/libgomp gnu/lib/libstdc++ gnu/usr.bin gnu/us...
Message-ID:  <4B69FA08.2070308@freebsd.org>
In-Reply-To: <201002032129.o13LT7kZ013039@svn.freebsd.org>
References:  <201002032129.o13LT7kZ013039@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Warner Losh wrote:
> Author: imp
> Date: Wed Feb  3 21:29:06 2010
> New Revision: 203446
> URL: http://svn.freebsd.org/changeset/base/203446
>
> Log:
>   Introduce MACHINE_CPUARCH.
>   
>   MACHINE is the specific kernel architecture for this machine.
>   MACHINE_ARCH is the specific CPU type (abi, word size, etc).
>   MACHINE_CPUARCH is the family of CPUs that's supported.
>   
>   Most of the tree conflates MACHINE_ARCH and MACHINE_CPUARCH since
>   historically they have been identical.  However, there's now a reason
>   to to split the two concepts.  NetBSD calls this MACHINE_CPU, but
>   that's already used for something else in FreeBSD, so MACHINE_CPUARCH
>   was selected instead.
>   
>   However, the sources in the tree have had a KLUDGE in the tree called
>   TARGET_BIG_ENDIAN to select which endian to compile the code for.
>   However, this is a cumbersome and awkward solution.  MACHINE_ARCH
>   really does need to be different for different endian because users
>   use it for things like their path.  Yet, the source tree also used
>   MACHINE_ARCH to figure out the MD code to use.  This source often
>   supports multiple MACHINE_ARCHs.  'mips' supports 32 (and soon 64) bit
>   word sizes as well as big and little endian.  'arm' support both
>   endians.  powerpc will soon support both 32-bit and 64-bit.
>   
>   These patches start to unwind this confusion.  It implements
>   MACHINE_ARCH of mipsel, mipseb for the two endians of MIPS, as well as
>   arm and armeb for ARM.  The names for ARM are historical accidents
>   (ARM was primarily little endian until relatively recently).  These
>   names follow the NetBSD convetions.
>   
>   With these changes, "make buildworld TARGET=mips TARGET_ARCH=mipsel"
>   finishes.  armeb and mipseb should work, but haven't been tested yet.
>   
>   Committed as one big chunk so that people can comment on the patches
>   as a whole and suggest improvements.
>
>   
Thanks for this!

How does this work for ABIs? For big vs. little endian, most if not all 
of the userland support code is invariant. But in the 64/32 bit case, 32 
and 64-bit PowerPC have wildly differing ABIs, to the point that there 
is extremely little overlap in the support code for things like libc and 
RTLD, and it doesn't make much sense to point them at the same 
directories. Should MACHINE_CPUARCH be different here, or is it worth 
introducing something like MACHINE_ABI as well? I suppose there are also 
individual hacks in Makefiles...
-Nathan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B69FA08.2070308>