RTEMS GCC BIG ENDIAN SUPPORT

Chris Johns chrisj at rtems.org
Tue Aug 6 21:56:26 UTC 2019


On 6/8/19 6:25 pm, Sebastian Huber wrote:
> On 06/08/2019 10:10, Aby Tom wrote:
>> Dear Sebastian Huber, Jonathan Brandmeyer and RTEMS community,
>> Thank you for your valuable inputs and suggestions to my problem with
>> big-endian targets.
>> I was able to resolve most of the issue by adding the CPU_FLAGS to linker as
>> well.
>> Now I have a few new errors; *‘**compiled for a little endian system and
>> target is big endian**’* which are just opposite of the previous ones.
> 
> You get errors like this if you build the BSP and your application (or
> libraries) with inconsistent machine flags. Use the CFLAGS and LDFLAGS of the
> BSP for your application and libraries.

The `rtems-exeinfo` [1] command can help with finding out where the flags are wrong. For example with the RPi2 BSP I have at hand you can see the machine flags used to build an object file with ..

$ rtems-exeinfo arm-rtems5/c/raspberrypi2/testsuites/samples/hello/hello-init.o                                                                                                                                                                                 
RTEMS Executable Info 5.3fab1f51102c-modified
 rtems-exeinfo arm-rtems5/c/raspberrypi2/testsuites/samples/hello/hello-init.o
exe: arm-rtems5/c/raspberrypi2/testsuites/samples/hello/hello-init.o

Compilation:
 Producers: 1
  |  GNU C11 7.4.0 20181206 (RTEMS 5, RSB 0956a2c089faf2600047577bb153afcaaba22288, Newlib 1d35a003f): 1 objects
 Common flags: 4
  | -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard

The tool currently does not operation on archives so you will have to extract the object files to checked them. It does work with object files and executables.

Chris

[1] https://docs.rtems.org/branches/master/user/tools/exeinfo.html



More information about the users mailing list