7 Feb 2010 20:08
host endianness
Iain Hibbert <plunky <at> rya-online.net>
2010-02-07 19:08:57 GMT
2010-02-07 19:08:57 GMT
Hi,
(think this might be toolchain related, flame away if not :)
In the native build of pcc(1), we use a pre-generated config.h which
contains HOST_(BIG|LITTLE)_ENDIAN and TARGET_(BIG|LITTLE)_ENDIAN
definitions which should really be provided at build time. I found
<bsd.endian.mk> which supplies TARGET_ENDIANNESS but nothing about the
host.
Is it ok to add the test below so I can supply the HOST_*_ENDIAN symbol to
the pcc build as appropriate? Its basically a copy of the
MACHINE_ARCH/TARGET_ENDIANNESS test already there..
regards,
iain
--- bsd.endian.mk 9 Jan 2008 11:26:14 -0000 1.15
+++ bsd.endian.mk 7 Feb 2010 18:57:17 -0000
<at> <at> -24,4 +24,23 <at> <at>
TARGET_ENDIANNESS= 4321
.endif
+.if ${HOST_ARCH} == "alpha" || \
+ ${HOST_ARCH} == "arm" || \
+ ${HOST_ARCH} == "i386" || \
+ ${HOST_ARCH} == "ia64" || \
+ ${HOST_ARCH} == "vax" || \
+ ${HOST_ARCH} == "x86_64" || \
+ ${HOST_ARCH:C/^.*el$/el/} == "el"
(Continue reading)
how about this:
echo -n 'C!' | od -h | sed 's/[^1234]*//;s/2143/4321/p;d'
RSS Feed