Problem with ARM toolchain - breaks TCP/IP

Jay Monkman jtm-list-rtems at smoothsmoothie.com
Fri Feb 25 05:56:27 UTC 2005


There's a problem in newlib versions before 1.13 that breaks TCP/IP
for ARM. This only affects code in the 4.7 branch in CVS - none of the
4.6.x releases seem to be affected.

In older versions of newlib, the BYTE_ORDER macro is always defined to
be big endian - even if the CPU is little endian. This doesn't seem to
have caused any problems until recently, when
cpukit/libnetworking/machine/endian.h was changed to protect
BYTE_ORDER against double definition. Before, BYTE_ORDER was always
redefined to the correct endian.

This is fixed with newlib-1.13. I tested w/ the CVS HEAD of gcc. 

If you don't want to rebuild the toolchain, a workaround is to modify
   cpukit/libnetworking/machine/endian.h
removing the #ifdef BYTE_ORDER:

----------------------------------------------------------------------
diff -u -b -B -u -r1.5 endian.h
--- endian.h    5 Nov 2004 16:18:53 -0000       1.5
+++ endian.h    25 Feb 2005 05:54:13 -0000
@@ -13,7 +13,7 @@
 #define BIG_ENDIAN     4321
 #define LITTLE_ENDIAN  1234

-#ifndef BYTE_ORDER
+/* #ifndef BYTE_ORDER */
 #if CPU_BIG_ENDIAN
 # define BYTE_ORDER BIG_ENDIAN
 #elif CPU_LITTLE_ENDIAN
@@ -21,7 +21,7 @@
 #else
 # error "Can't decide which end is which!"
 #endif
-#endif
+/* #endif */
----------------------------------------------------------------------




More information about the users mailing list