74

What is the difference between arm-eabi, gnueabi and gnueabi-hf cross compilers?

0

1 Answer 1

66

I'm not completely sure:

  • the eabi stands for the compilation of code which will run on bare metal arm core.
  • the gnueabi stands for the compilation of code for linux

For the gnueabi/gnueabi-hf part, I found an answer here.

gcc-arm-linux-gnueabi is the cross-toolchain package for the armel architecture. This toolchain implies the EABI generated by gcc's -mfloat-abi=soft or -mfloat-abi=softfp options.

gcc-arm-linux-gnueabihf is the cross-toolchain package for the armhf architecture. This toolchain implies the EABI generated by the gcc -mfloat-abi=hard option.

'hf' means hard-float which indicates that the compiler and its underlying libraries are using hardware floating point instructions rather than a software implementation of floating point such as fixed point software implementations. The 'eabi' refers to what the underlying binary is going to look like. It can be argued that these can be achieved with flags to gcc but the issue is that of bare metal pre-compiled libraries. Unless you are recompiling everything from source, it may not be feasible to use gcc with flags alone. Even in that case you might have to carefully configure each package or library with the appropriate compile options.

8
  • 11
    See also: wiki.linaro.org/WorkingGroups/ToolChain/… The bare-metal ABI (eabi) will assume a different C library (newlib for example, or even no C library) to the Linux ABI (gnueabi, which assumes glibc). Therefore, the compiler may make different function calls depending on what it believes is available above and beyond the Standard C library.
    – Lekensteyn
    Aug 10, 2015 at 20:27
  • 2
    Although I see you've pulled this from an external source, the use of architecture here is misleading. The difference between armel and armhf is fundamentally the difference between the software floating point and hardware floating point EABI generated by the compilers.
    – sherrellbc
    Jun 20, 2017 at 19:01
  • 4
    The wording is fine, aside from the use of architecture in your quote. I mention it's misleading only because there is no armel architecture -- it's always going to be a compiler for the ARM architecture. The compiler is going to use a specific EABI for use on such an architecture depending on the parameters given during compilation. As your comment states, gcc is instructed to use use soft floating point mechanisms, rather than support hardware floating point mechanisms (this is necessary if there is no FPU). Also noteworthy is the armeb option, which is armel using big endian order.
    – sherrellbc
    Jul 13, 2017 at 15:58
  • 3
    One more question. Why there are 2 toolchains (-gnueabi and -gnueabihf). Why not 1 toolchain which understands -mfloat-abi=soft/hard/softfp option (like native arm linux gcc)? Sep 26, 2019 at 15:57
  • 6
    @AntonOstrouhhov I found the answer! Toolchain means not only compiler, but also binutils, already compiled libraries (libc) etc. => 2 toolchains: one includes libraries with Soft ABI, another with Hard ABI :) Sep 26, 2019 at 16:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.