Building ARM in big-endian mode
Joel Sherrill
joel.sherrill at OARcorp.com
Mon Feb 24 21:20:45 UTC 2003
Charles Steaderman wrote:
>
> I would like to rebuild RTEMS and my application for ARM in big-endian mode.
> Currently, I have RPM based tools installed under Linux (gcc-3.2.1/newlib-1.10).
> When I modify my bsp cfg file with -mbig-endian and rebuild RTEMS, I get the
> following error:
>
> arm-rtems-gcc --pipe -B../../../../lib/ -B../../../../pwrlink/lib/ -specs
> bsp_specs -qrtems -ansi -fasm -O3 -mcpu=arm7tdmi
> -mstructure-size-boundary=8 -mbig-endian -o o-optimize/no-dpmem.o -c
> ../../../../../../rtems/c/src/optman/rtems/no-dpmem.c
> test -d o-optimize || mkdir o-optimize
> arm-rtems-gcc --pipe -B../../../../lib/ -B../../../../pwrlink/lib/ -specs
> bsp_specs -qrtems -O3 -mcpu=arm7tdmi -mstructure-size-boundary=8 -mbig-endian
> -L ../../../../pwrlink/lib -o o-optimize/no-dpmem.rel -qnolinkcmds -nostdlib
> -Wl,-r o-optimize/no-dpmem.o
> /opt/rtems/lib/gcc-lib/arm-rtems/3.2.1/../../../../arm-rtems/bin/ld:
> o-optimize/no-dpmem.o: compiled for a big endian system and target is little endian
> File in wrong format: failed to merge target specific data of file
> o-optimize/no-dpmem.o
> collect2: ld returned 1 exit status
> gmake[4]: *** [o-optimize/no-dpmem.rel] Error 1
>
> I assume that this means I need to rebuild newlib?
No these files are part of RTEMS.
> At what point in the
> configure/make process do I specify that I want big-endian and are there other
> defines (-DBIG_ENDIAN???) that I need to specify?
This is more right. Apparently, -mbig-endian is not being honored by
the
loader (ld) so when we do "ld -r" it doesn't like that the source is big
endian and the default target is little endian.
Honestly, if you want big endian through out, I think you would be
better off
building another entire toolset variant like armbe-rtems or whatever it
is
called so the defaults match up nicely. This will take a bit of
tinkering
with the aclocal macros that determine the RTEMS CPU name from the
target
name. And no matter what, the code inside RTEMS that says the arm is
big or little endian will have to be conditional based upon something
the
toolset says.
> - Charlie
>
> --
> Charlie Steaderman
> charlies at poliac.com
> VP Engineering
> Poliac Research Corporation
> Phone: 952.707.6245
> Cel: 612.242.6364
--
Joel Sherrill, Ph.D. Director of Research & Development
joel at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list