Differences between versions of arm series cross compilers

Cross Compiler Naming Rules

Naming rules for cross compilers: arch [-vendor] [-os] [-(gnu)eabi] [-language]

  • arch - architecture, such as arm (ARM-32bit), aarch64 (ARM-64bit), x86, etc.;
  • vendor - the toolchain provider, often omitted, or replaced by none;
  • os - the target operating system, such as linux, if there is no specific os, use none instead. Also no vendor and os use a none instead.
  • eabi - Embedded Application binary Interface
  • language - compiled language, such as gcc, g++

Examples of specific compilers

crosstool-ng cross compilation tool sample

The official website of crosstool-ng, which makes the cross-compilation toolchain, lists many samples of cross-compilation tools , all of which are named according to the above naming rules.

aarch64-ol7u9-linux-gnu
aarch64-ol8u6-linux-gnu
aarch64-ol8u7-linux-gnu
aarch64-rpi3-linux-gnu
aarch64-rpi4-linux-gnu
aarch64-unknown-linux-gnu
aarch64-unknown-linux-uclibc
arm-bare_newlib_cortex_m3_nommu-eabi
arm-cortex_a15-linux-gnueabihf
arm-cortexa5-linux-uclibcgnueabihf
arm-cortex_a8-linux-gnueabi
arm-cortexa9_neon-linux-gnueabihf
arm-multilib-linux-uclibcgnueabi
arm-nano-eabi
arm-none-eabi
arm-ol7u9-linux-gnueabi
arm-ol7u9-linux-gnueabihf
arm-picolibc-eabi
arm-unknown-eabi
arm-unknown-linux-gnueabi
arm-unknown-linux-musleabi
arm-unknown-linux-uclibcgnueabi
arm-unknown-linux-uclibcgnueabihf
x86_64-centos7-linux-gnu
x86_64-multilib-linux-gnu
x86_64-multilib-linux-musl
x86_64-multilib-linux-uclibc
x86_64-multilib-linux-uclibc,moxie-unknown-moxiebox
x86_64-multilib-linux-uclibc,powerpc-unknown-elf
x86_64-ol8u6-linux-gnu
x86_64-ol8u7-linux-gnu
x86_64-pc-linux-gnu,arm-picolibc-eabi
x86_64-ubuntu14.04-linux-gnu
x86_64-ubuntu16.04-linux-gnu
x86_64-unknown-linux-gnu
x86_64-unknown-linux-uclibc
x86_64-w64-mingw32
x86_64-w64-mingw32,arm-cortexa9_neon-linux-gnueabihf
x86_64-w64-mingw32,x86_64-pc-linux-gnu

Example of arm cross compiler

  • arm-none-eabi-gcc

ARM architecture,no vendor,not target an operating system,complies with the ARM EABI(ARM 程序接口)

It is used to compile the bare-metal system of ARM architecture (including ARM Linux boot and kernel, not suitable for compiling Linux Application), generally used for ARM MCU series chips, such as ARM7, Cortex-M and Cortex-R, no operating system, no support Those functions that are closely related to the operating system use newlib, a C library dedicated to embedded systems, the installation method:

sudo apt-get install gcc-arm-none-eabi
  • arm-linux-gnueabi-gcc

ARM architecture, creates binaries that run on the Linux operating system, and uses the GNU EABI (GUN 程序接口)

Also called arm-none-linux-gnueabi-gcc, because there was no publisher at the beginning, it is currently issued by Linaro, and it is generally used for ARM9, ARM11, Arm Cortex-A series chips with a Linux operating system. The former is for 32-bit chips, and the latter is for 64-bit chips, using the glibc library. It can be used to cross-compile the code of all links in the ARM system, including bare-metal programs, u-boot, Linux kernel, filesystem and App applications. Installation method:

sudo apt-get install gcc-arm-linux-gnueabi
  • arm-linux-gnueabihf-gcc

The difference from arm-linux-gnueabi-gcc is that the default value of the gcc option -mfloat-abi is different, that is, the floating point number processing is different, see the answer below for details.
• aarch64-none-linux-gnu-gcc

It is the ARM-64bit version of arm-linux-gnueabi-gcc and arm-linux-gnueabihf-gcc.

  • arm-eabi-gcc

Android ARM compiler.

  • arm-none-uclinuxeabi-gcc

For uCLinux, use glibc.

  • arm-none-symbianelf-gcc

for symbian.

several concepts

ABI plus EABI

ABI: Application Binary Interface (Application Binary Interface). In computing, an application binary interface describes the low-level interface between an application (or other type) and the operating system or other applications;

EABI: Embedded ABI, the binary application program interface (Embeded Application Binary Interface) applied to embedded systems.

The main difference between the two is that ABI is on the computer, and EABI is on the embedded platform (such as ARM, MIPS, etc.).

gnueabi and gnueabihf

gcc-arm-linux-gnueabi – The GNU C compiler for armel architecture
gcc-arm-linux-gnueabihf – The GNU C compiler for armhf architecture

These two cross-compilers are suitable for two different architectures of armel and armhf. The two architectures of armel and armhf adopt different strategies for floating-point operations (arm with fpu can support these two floating-point operation strategies).

In fact, these two cross compilers are just different default values ​​of the gcc option -mfloat-abi. The gcc option -mfloat-abi has three values: soft, softfp, and hard (the latter two require an fpu floating-point unit in the arm, and soft is compatible with the latter two, but softfp and hard are incompatible with each other. ):

soft: Do not use fpu for floating-point calculations, even if there is an fpu floating-point unit, but use software mode.

softfp: The default value adopted by the armel architecture (the corresponding compiler is gcc-arm-linux-gnueabi), which is calculated by fpu, but the parameters are passed by ordinary registers, so that when interrupting, only ordinary registers need to be saved, and the interrupt load is small. But the parameters need to be converted to floating point for recalculation.

hard: the default value adopted by the armhf architecture (the corresponding compiler gcc-arm-linux-gnueabihf), calculated by fpu, and the parameters are also passed by the floating-point registers in fpu, which saves the conversion and has the best performance, but the interrupt load high.

reference

Guess you like

Origin blog.csdn.net/benkaoya/article/details/129542585