Naming conventions for cross-compilation toolchains

Publisher:csZhouLatest update time:2020-08-31 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Naming convention

The naming convention for the cross-compilation toolchain is: arch [-vendor] [-os] [-(gnu)eabi]

Depending on whether the operating system is supported or not, ARM GCC can be divided into those that support the operating system and those that do not.

arm-none-eabi: This does not have an operating system, so it cannot support functions that are closely related to the operating system, such as fork(2). It uses newlib, a C library specifically for embedded systems. arm-none-linux-eabi: For Linux, it uses Glibc


Examples 

1. arm-none-eabi-gcc

(ARM architecture, no vendor, not target an operating system, complies with the ARM EABI) is used to compile bare-metal systems for the ARM architecture (including the ARM Linux boot and kernel, but not for compiling Linux applications). It is generally suitable for chips with ARM7, Cortex-M and Cortex-R cores, so it does not support functions closely related to the operating system, such as fork(2). It uses newlib, a C library specifically for embedded systems.


2. arm-none-linux-gnueabi-gcc

(ARM architecture, no vendor, creates binaries that run on the Linux operating system, and uses the GNU EABI)

Mainly used for Linux systems based on ARM architecture, it can be used to compile ARM architecture u-boot, Linux kernel, Linux applications, etc. arm-none-linux-gnueabi is based on GCC, uses the Glibc library, and is optimized by Codesourcery. The floating-point operation of arm-none-linux-gnueabi-xxx cross-compilation tool is excellent. Generally, ARM9, ARM11, Cortex-A cores with Linux operating systems will use it.


3. arm-eabi-gcc

Android ARM compiler.


4. armcc

The compiler tool launched by ARM has similar functions to arm-none-eabi. It can compile bare metal programs (u-boot, kernel), but cannot compile Linux applications. armcc is usually used together with ARM development tools. The compilers in KeilMDK, ADS, RVDS and DS-5 are all armcc, so armcc compilers are all charged (except the patriotic version, hehe~~).


5. arm-none-uclinuxeabi-gcc and arm-none-symbianelf-gcc

arm-none-uclinuxeabi is for uCLinux, using Glibc.

arm-none-symbianelf is used for Symbian, I have never used it and don’t know what the C library is.

ABI and EABI

ABI: Application Binary Interface (ABI) for the ARM Architecture. In computers, the 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 Embedded Application Binary Interface specifies standard conventions for file formats, data types, register usage, stack organization optimization, and parameters in an embedded software. Developers using their own assembly language can also use EABI as an interface to the assembly language generated by a compatible compiler.


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


arm-linux-gnueabi-gcc and arm-linux-gnueabihf-gcc

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


In fact, the two cross compilers are just different in the default value of gcc option -mfloat-abi. gcc option -mfloat-abi has three values: soft, softfp, and hard (the latter two require the arm to have an fpu floating point unit, and soft is compatible with the latter two, but softfp and hard are incompatible with each other): soft: do not use the fpu for floating point calculations, even if there is an fpu floating point unit, but use software mode. 


softfp: The default value used by the armel architecture (the corresponding compiler is arm-linux-gnueabi-gcc). It uses fpu for calculations, but passes parameters using ordinary registers. In this way, when an interrupt occurs, only ordinary registers need to be saved, and the interrupt load is small, but the parameters need to be converted into floating point before calculation. 


hard: The default value used by the armhf architecture (the corresponding compiler arm-linux-gnueabihf-gcc). It uses the fpu for calculations and the floating-point registers in the fpu for parameter transfer, eliminating the need for conversion. It has the best performance but a high interrupt load.

Save the C file contents used in the following test as mfloat.c:

1. Compile with arm-linux-gnueabihf-gcc and use the "-v" option to get more detailed information:

# arm-linux-gnueabihf-gcc -v mfloat.c COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=vfpv3-d16′ '-mthumb' -mfloat-abi=hard

It can be seen that hard hardware floating-point mode is used.


2. Compile using arm-linux-gnueabi-gcc:

# arm-linux-gnueabi-gcc -v mfloat.c COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16′ '-mthumb' -mfloat-abi=softfp

It can be seen that softfp mode is used.

Reference address:Naming conventions for cross-compilation toolchains

Previous article:Understanding the JTAG interface of embedded development ARM technology in one article
Next article:A detailed explanation of the solution for embedded system development based on ARM

Recommended ReadingLatest update time:2024-11-16 12:50

ARM assembly language learning notes (V) passing parameters to C language and getting return values
First, the purpose How to pass parameters to C function How to get the return value of a C function 2. How to pass parameters We pass parameters by giving register values This is reflected in the code as: First give register r0 a value, then bl calls the function led_on mov r0, #4 bl led_on This is led_on
[Microcontroller]
ARM assembly language learning notes (V) passing parameters to C language and getting return values
From the simplest example, take you to easily learn the ARM instruction set
First edit a simplest function, including variable allocation and initialization: test1.c 1. #include    2.    3. void main()   4. {   5.   int d = 4;   6. }   Then compile: arm - linux -gnueabihf-gcc test.c -o test1 Then look at the assembly code: arm-linux-gnueabihf-objdump -D test1; I have given detailed comment
[Microcontroller]
From the simplest example, take you to easily learn the ARM instruction set
ARM Assembly Tutorial under Linux
Part 1 ARM Assembly Syntax under Linux Although it is convenient to write programs in C or C++ under Linux, the assembly source program is used for the most basic system initialization, such as initializing the stack pointer, setting up the page table, and operating the ARM coprocessor. After the initialization is comp
[Microcontroller]
ARM interrupt handling [Part 2]
Status of interrupt source GIC's processing of an interrupt source includes four states: Inactive, Pending, Active, and Active and Pending. When an interrupt source is not asserted (triggered), it is in the initial "Inactive" state. If an interrupt source is triggered, the GIC will set the bit corresponding to the
[Microcontroller]
ARM register analysis and exception handling methods
ARM has 7 basic working modes User: Non-privileged mode, most tasks are executed in this mode FIQ: This mode will be entered when a high-priority (fast) interrupt is generated IRQ: When a low-priority (normal) interrupt is generated This mode will be entered when an interrupt occurs. Supervisor: This mode will be e
[Microcontroller]
ARM register analysis and exception handling methods
ARM Linux Interrupt Analysis
Introduction: Linux has prepared the address of each interrupt vector when it is initialized! That is to say, the framework for adding an interrupt service program has been given. When an interrupt occurs, it will go to a certain address to find instructions. Therefore, when we make a driver, we only need to use reque
[Microcontroller]
Linux ARM (IMX6U) bare metal assembly LED driver experiment--driver writing
1. Initialization of i.MX6ULL ①、Enable clock Enable clock. The seven registers CCGR0-CCGR6 control the enable of all peripheral clocks of i.MX6ULL. For simplicity, set all seven registers CCGR0-CCGR6 to 0xFFFFFFFF, which is equivalent to enabling all peripheral clocks. CCGR0: CCGR1: CCGR2: CCGR3: CCGR4: CC
[Microcontroller]
Linux ARM (IMX6U) bare metal assembly LED driver experiment--driver writing
Memory Mapping of ARM Linux (S3C6410 Architecture/2.6.35 Kernel) (V)
Access control for ARM Linux The ARM1176JZF-S processor defines two levels of access control: the first level is the "domain" access type, and the second level is the "read and write permissions" of the page or segment. Specifically, the process is as follows: 1.  In the ARM processor, the MMU divides the entire s
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号