tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

host endianness



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
@@ -24,4 +24,23 @@
 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"
+HOST_ENDIANNESS=       1234
+.elif ${HOST_ARCH} == "hppa" || \
+      ${HOST_ARCH} == "m68000" || \
+      ${HOST_ARCH} == "m68k" || \
+      ${HOST_ARCH} == "powerpc" || \
+      ${HOST_ARCH} == "powerpc64" || \
+      ${HOST_ARCH} == "sparc" || \
+      ${HOST_ARCH} == "sparc64" || \
+      ${HOST_ARCH:C/^.*eb$/eb/} == "eb"
+HOST_ENDIANNESS=       4321
+.endif
+
 .endif  # !defined(_BSD_ENDIAN_MK_)





Home | Main Index | Thread Index | Old Index