Difference between arm-none-eabi and arm-linux-gnueabi?
Asked Answered
O

1

21

What is the difference between arm-none-eabi and arm-linux-gnueabi? I know the difference in how to use them (one for bare metal software, the other one for software meant to be run on linux). But what is the technical background?

I see there is a difference in the ABI which is, as far as I understood, something like an API but on binary level. It ensures interoperability of different applications.

But I don't really understand in which way having or not having an operating system affects my toolchain. The only thing that came to my mind is, that libraries maybe have to be statically linked (do they?) while compiling bare metal software, because there is no os dynamically providing them.

The most pages I found related to this toppic just answered how to use the toolchains but not the technical background. I'm a student of mechatronics and new to embedded systems, so my experience in this field is somewhat limited.

Ovular answered 15/8, 2016 at 14:8 Comment(6)
Yes it is mostly a library thing, trying to tune for running on linux (libc, etc) vs I think newlib. For bare metal work, either is fine as they can both make assembly from C and make objects from assembly and link with your own linker scripts, etc. And the bare metal i am talking about is one without standard libraries and/or you use this tool to create your own libraries from sources. Basically they both work as generic cross compilers, if you want/need built in library support, then it may matter which one you use.Idiom
@dwelch: There is no need to use any library on bare-metal. You just possibly have to provide some functions (mostly memcpy, etc.) gcc might call (e.g. when assignming structs).Custody
@Olaf I dont use C libraries on bare metal, but some folks do, and of those some use newlib (or whatever is friendly to that build), and of those some want to use arm-none-eabi instead of arm-linux-gnueabi because it does matter to them. So it depends on what the OP is targeting as to whether or not the differences matter.Idiom
@dwelch: I strongly doubt arm-linux-gnueabi will work for bare-metal systems. Never tried it, though. For one, iirc, arm-none-* is a freestanding implementation by default, so it does not rely on the C stdlib for hosted systems and gcc does not use its built-in optimisations for certain standard library functions.Custody
@Olaf most if not all of my work and personal bare metal code can use either variant as I dont rely on anything but a compiler that can make asm from C and assembler that can make machine code from asm, and a linker that links only the things I have supplied together. It is very dependent though on the user and their code and build system. More likely to get tripped up with the -linux- one. And yes the gcc lib things can very quickly get system dependent so I control those as well.Idiom
@dwelch: Same for me. That way I have to search problems in my own parts nad not some 3rd source libraries. As I wrote, I never tried and never researched about the differences. Maybe the question is not that bad after all. I did not talk about the libgcc, but the C standard library as implemented e.g. by newlib or glibc. libgcc is hardly to avoid, but of course, you can implement its functions in your own library (I don't see much sense in that, though, as it has no external dependencies and is target-specific).Custody
P
12

Maybe this link to a description will help.

Probably the biggest difference:

"The bare-metal ABI will assume a different C library (newlib for example, or even no C library) to the Linux ABI (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."

Potpourri answered 17/8, 2016 at 6:48 Comment(2)
Link Down! :( :(Decarbonize
@Decarbonize Try thisMousse

© 2022 - 2024 — McMap. All rights reserved.