Detailed cross-compiler

1. What is cross-compiler

Embedded developers are generally in the x86 platform, and the translation of the software to run on the arm platform, you need to cross-compiler, cross means that on one architecture to another architecture compile the code. Limited arm platform general resources, not suitable for development

Cross compiler installation

With Linaro gcc as an example:
1.sudo APT-GET install gcc-ARM-Linux-gnueabihf
2. Download the official website: https: //releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabihf /
Here Insert Picture Description
Here Insert Picture Description

Naming Rules

Here Insert Picture DescriptionHere Insert Picture Description
In arm-linux-gnueabihf-gcc an example meaning of each field
1.arm represents certain chip architecture, if it is big endian mode the armeb or armbe
2.Linux represented linux operating system environment, can use the standard library under linux c or API linux kernel provides. armeabi-gcc or arm-none-eabi-gcc expressed their targets without running the operating system environment. The actual development basically use arm-linux-gnueabihf-gcc, including bare metal and uboot, the kernel code itself, if not used linux related not go wrong, but this is not precise enough, so it is best to use arm-none-eabi-gcc
3. Expresses to gnu c library types glibc libraries
4.eabi represent embedded architecture
5.hf: hardware floating-point mode, no hf represents the software floating-point mode
6. compiler version number, usually backward compatible, However, some programs require a specific version of the compiler

The impact of the program compiler type

Compilers and libraries should be coordinated, if you use software floating-point compiler, libraries provide an error occurs is hard floating-point mode

Published 24 original articles · won praise 1 · views 1772

Guess you like

Origin blog.csdn.net/qq_27182175/article/details/103006302