arm gcc toolchain as arm-elf or arm-none-eabi, what is the difference?

GccArmElfCortex M3Eabi

Gcc Problem Overview


When you build a gcc toolchain there is the possibility to build it as arm-elf or as arm-none-eabi, but what is the difference?

I use the eabi today, but that is just since everyone else seem to do that... but since that is a really bad argument, it would be really nice to understand the difference.

Note: This toolchain will crosscompile code for Cortex-M3 based mcu:s like the stm32.

Thanks


Some links:

EABI:

ELF:

Gcc Solutions


Solution 1 - Gcc

Here is an excellent explanation.

Toolchains follow the loose naming convention: arch [-vendor] [-os] -eabi

  arch    refers to target architecture (which in our case is ARM)
  vendor  refers to toolchain supplier
  os      refers to the target operating system
  eabi    refers to Embedded Application Binary Interface

Some examples:

arm-none-eabi: This toolchain targets the ARM architecture, has no vendor, does not target any operating system, and complies with the ARM EABI.

arm-none-linux-gnueabi: This toolchain targets the ARM architecture, has no vendor, creates binaries that run on the Linux operating system, and uses the GNU EABI. It is used to target ARM-based Linux systems.

Solution 2 - Gcc

Each architecture or architecture/os couple has an ABI. The ABI (Application binary Interface) describes how functions should be called, syscalls numbers, arguments passed, which registers can be used ...

The abi describes how the compiler should generate the assembly.

If you use only assembler you don't need to care about the ABI.

arm-elf and arm-none-eabi just use two versions of the Arm ABI. The eabi toolchain uses a newer revision, but could also be called arm-elf-eabi, as it generates elf too.

Solution 3 - Gcc

As I know:

arm-elf toolchain generates obj code for some OS which support executing elf format (example linux ABI). OS will control executing of your program.

arm-none-eabi toolchain generates obj code for micro-controllers or microprocessors (for bare metal, this will be EABI - embedded ABI). This code are downloaded to clean flash of MC and core of MC start executing it after power-on. No OS, extended command set, no possibility for linking with shared modules.

Solution 4 - Gcc

The ARM EABI is a standard created by ARM that allows different toolchains to create compatible objects. For instance, so that one toolchain can link objects created by another toolchain.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohanView Question on Stackoverflow
Solution 1 - GcczhigangView Answer on Stackoverflow
Solution 2 - GccpaulView Answer on Stackoverflow
Solution 3 - GccdartanView Answer on Stackoverflow
Solution 4 - GccRoger DahlView Answer on Stackoverflow