Subject: Re: selecting ARM endianness [was: CVS commit: syssrc]
To: None <itojun@iijlab.net>
From: Ben Harris <bjh21@netbsd.org>
List: source-changes
Date: 02/19/2001 12:06:44
On Mon, 19 Feb 2001 itojun@iijlab.net wrote:

> >> Re-introduce <arm/endian_machdep.h>, this time using GCC's idea of the target
> >> endianness.
> >
> >Is this a totally safe way to do things?  For the MIPS ports, each
> >port's endianness is specified in the appropriate endian_machdep.h.
> >Just wondering...
> 
> 	we did it for evbsh3/include/endian_machdep.h, however I don't really
> 	feel it safe enough.  the symbol definition can change easily if
> 	we use different cpp (or cc -E).

cc -E seems to get all the predefines correctly:

viking:~$ /opt/netbsd/cross/bin/arm-unknown-netbsdelf-gcc -v -E -x c /dev/null
Reading specs from /opt/netbsd/cross/lib/gcc-lib/arm-unknown-netbsdelf/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /opt/netbsd/cross/lib/gcc-lib/arm-unknown-netbsdelf/2.95.2/cpp -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dunix -Darm -D__arm__ -D__NetBSD__ -D__ELF__ -D__unix__ -D__arm__ -D__arm__ -D__NetBSD__ -D__ELF__ -D__unix -D__arm -Asystem(unix) -Asystem(NetBSD) -Acpu(arm) -Amachine(arm) -D__CHAR_UNSIGNED__ -D__ARM_ARCH_3__ -D__APCS_32__ -D__SOFTFP__ -D__VFP_FP__ /dev/null
GNU CPP version 2.95.2 19991024 (release) (ARM NetBSD/ELF)
[...]

Using a different CPP is a problem, but there's already code that depends
on other predefines working OK, so anyone expecting to get the right
behaviour out of a CPP other than cc -E is going to lose anyway.

-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/arm26               <URL:http://www.netbsd.org/Ports/arm26/>