Cross compile from linux to ARM-ELF (ARM926EJ-S/MT7108)
apt-cache search arm | grep ^gcc-
gives the following list,
- gcc-4.7-aarch64-linux-gnu - GNU C compiler
- gcc-4.7-arm-linux-gnueabi - GNU C compiler
- gcc-4.7-arm-linux-gnueabi-base - GCC, the GNU Compiler Collection (base package)
- gcc-4.7-arm-linux-gnueabihf - GNU C compiler
- gcc-4.7-arm-linux-gnueabihf-base - GCC, the GNU Compiler Collection (base package)
- gcc-4.7-multilib-arm-linux-gnueabi - GNU C compiler (multilib files)
- gcc-4.7-multilib-arm-linux-gnueabihf - GNU C compiler (multilib files)
- gcc-aarch64-linux-gnu - The GNU C compiler for arm64 architecture
- gcc-arm-linux-gnueabi - The GNU C compiler for armel architecture
- gcc-arm-linux-gnueabihf - The GNU C compiler for armhf architecture
You should install gcc-arm-linux-gnueabi which is an alias for gcc-4.7-arm-linux-gnueabi. gcc-4.7-multilib-arm-linux-gnueabi is also possible, but more complicated. Use the flags, -march=armv5te -mtune=arm926ej-s -msoft-float -mfloat-abi=soft
. You can do more tuning by specifying the --param NAME=VALUE
option to gcc
with parameters tuned to your systems memory sub-system timing.
You may not be able to use these gcc
versions as your Linux maybe compiled with OABI and/or be quite ancient compared to the one the compiler was built for. In some cases, the libc will call a newer Linux API, which may not be present. If the compiler/libc was not configured to be backwards compatible, then it may not work with your system. You can use crosstool-ng to create a custom compiler that is built to suit your system, but this is much more complex.
Making use of -mfloat-abi=hard and -mfpu=vfp/neon Codesourcery Lite 2013.05-24
The Sourcery CodeBench Lite toolchain does not support armhf. Nor do the Academic or Personal editions.
You'll need to purchase the Standard or Professional editions to get that.
Alternatively, I believe the cross-compiler packages for Ubuntu support the configuration you need (in fact, only that configuration).
If you're not using Ubuntu, then the pre-built Linaro toolchains should be exactly what you need. (The Ubuntu cross compiler packages are/were also built by Linaro people, albeit using the Debian/Ubuntu-specific deb build system.)
Related Topics
How to Display Only Files from Aws S3 Ls Command
Pytorch Says That Cuda Is Not Available
How to Add Chromedriver to Path in Linux
How to Use Both 64 Bit and 32 Bit Instructions in the Same Executable in 64 Bit Linux
Behavior of Cd/Bash on Symbolic Links
Check If a Program in a Specific Path Is Running
Prohibit Unaligned Memory Accesses on X86/X86_64
/Usr/Bin/Ld: Skipping Incompatible Foo.So When Searching for Foo
Capture Both Exit Status and Output from a System Call in R
How to Disable or Change the Timeout Limit for the Gpu Under Linux
How to Program for Linux's New 'Fanotify' File System Monitoring Feature
Does Cron Expression in Unix/Linux Allow Specifying Exact Start and End Dates
How to Rebuild Rootfs in Buildroot
How Does Copy_From_User from the Linux Kernel Work Internally
Comparing Variables with Strings Bash
Use Crontab Job Send Mail, the Email Text Turns to an Attached File Which Named Att00001.Bin