I am hoping to use GCC to compile code for the TMS570LS3137 or TMS570LS43x processor which are big endian Cortex-R4 and Cortex-R5F respectively.
I have found some old instructions here: TMS570LS and GCC compiler - Hercules safety microcontrollers forum - Hercules ︎ safety microcontrollers - TI E2E support forums. I will attempt to follow them today.
Can anyone provide some explanation of how to build GCC including the libraries for big endian? Is there a recent, pre-build set of tools that support these processors?
I've not tested with these devices, but do you not just need to add "-mbig-endian" to the compiler command line?
Which gcc release are you using? Arm provides the below:
I'm afraid the binary releases for the RM profile builds of GCC do not contain big-endian multilibs.
So while the compiler may be able to generate code using -mbig-endian it would be able to link this to an executable.
Some headers will also likely be missing.
This has been my experience.
Are there any instructions to build the big-endian multilibs?
Not that I am aware of, if you just require a cross build you have two options:
Use a tool such as https://github.com/crosstool-ng/crosstool-ng which allows you to generate a compiler for a specific target.
You can then just create a big endian target using this. Otherwise you could download the source for the GNU releases and modify the multilibs list to include a big endian multilib.
We did build a version with big-endian support:https://www.sciopta.de/ftp/
Not sure if anyone else
I recently struggled through this problem. It is easy to compile big endian using -mbig-endian, but the program cannot be linked if only little-endian libraries are provided.
After much toil in trying to build a GCC cross-compiler and search the internet for solution, I found binaries for a big-endian cross compiler (armeb) on linaro.org here:
If you are using Microsoft Windows, unzip gcc-linaro-7.5.0-2019.12-i686-mingw32_armeb-eabi.tar.xz somewhere on your computer. If you are using CCS you can then add the toolchain in your preferences. You will have to manually configure all of the compiler options (endianness, architecture, CPU, FPU, etc). I was able to build, link and execute the whole thing on TMS570LS1224 with no problems.
You must compile everything with option -mbig-endian; however, if the big endian libraries are not present in the toolchain, then the linker will fail due to the built-in libraries being incompatible with the compiled code.
Thanks, I will check this out. I'll report back if it works for me.
Thanks, I will check it out and report back if it works for me.
View all questions in Arm Compilers forum