Problem with TCP socket on RTEMS 4.8.1 (ARM BSP)

Ralf Corsepius ralf.corsepius at rtems.org
Wed Sep 3 07:51:28 UTC 2008


On Wed, 2008-09-03 at 07:52 +0600, Alex Zolotov wrote:
>         >> /opt/rtems-4.10/bin/arm-rtems4.10-gcc
>         >> #define __ARMEL__ 1
>         >> /opt/rtems-4.6/bin/arm-rtems-gcc
>         >> #define __ARMEL__ 1
>         >> /opt/rtems-4.7/bin/arm-rtems4.7-gcc
>         >> #define __ARMEL__ 1
>         >> /opt/rtems-4.8/bin/arm-rtems4.8-gcc
>         >> #define __ARMEL__ 1
>         >> /opt/rtems-4.9/bin/arm-rtems4.9-gcc
>         >> #define __ARMEL__ 1
>         >>
>         >> 
> It's true. But machine/endian.h (from Newlib) has following:
> #ifndef BYTE_ORDER
> #ifdef __IEEE_LITTLE_ENDIAN
> #define BYTE_ORDER LITTLE_ENDIAN
> #else
> #define BYTE_ORDER BIG_ENDIAN
> #endif
> #endif
> And result of this code: BYTE_ORDER = BIG_ENDIAN :)  And this
> definition used by TCPIP functions.

OK, this the old arm/endianness-bug in newlib, I had fixed a long time
ago. Apparently, it is fixed in rtems-4.9 and rtems-4.10's toolchains,
but still seems to be present in rtems-4.8:

> cat tmp.c
#include <machine/endian.h>

> arm-rtems4.8-gcc -Wp,-dD -save-temps -c tmp.c
> grep ENDIAN tmp.i
#define __IEEE_BIG_ENDIAN 
#define __IEEE_BYTES_LITTLE_ENDIAN 
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234
#define BYTE_ORDER BIG_ENDIAN

> arm-rtems4.9-gcc -Wp,-dD -save-temps -c tmp.c
> grep ENDIAN tmp.i
#define __IEEE_LITTLE_ENDIAN 
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234
#define BYTE_ORDER LITTLE_ENDIAN

> arm-rtems4.10-gcc -Wp,-dD -save-temps -c tmp.c
> grep ENDIAN tmp.i
#define __IEEE_LITTLE_ENDIAN 
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234
#define BYTE_ORDER LITTLE_ENDIAN


Ralf





More information about the users mailing list