For eg. arm-unknown-linux-gnueabi Now, once the OS i.e Linux is fixed, the C Library will be fixed (GLibc) and hence the calling convention and ABI being followed will be fixed. What is the requirement of 4th field i.e. ABI separately? Can a toolchain use a different ABI from the one used by underlying OS and LIBC. In that case how will libraries compiled by the said toolchain run on the OS?
Advertisement
Answer
It’s more or less a matter of historical reasons, a.k.a the holy wars about the sacred operating system’s name. What you call the “toolchain name” is actually called the Target Triplet, and as it name imply, it has three fields, not either more or less. In your example case, the fields would be:
- Machine/CPU:
arm
- Vendor:
unknown
- Operating System:
linux-gnueabi
Take another reference example I’ve already faced: i686-elf-gcc
, which is used for hobbyist operating system development:
- Machine/CPU:
i686-elf
- Vendor:
unknown
(implicit) - Operating System:
none
(implicit; the compiler is actually a freestanding cross compiler, used for the development of operating system kernels, thus the code it outputs expects no underlying OS, as the output code is the OS itself!).
This is just a matter of confusion originating from the fact that the fields may (and do) use the -
character, which is used to separate the fields, too. In your case, the OS is considered to be linux-gnueabi
, otherwise known as the GNU operating system with the Linux kernel using the Embedded ARM ABI. The Linux Kernel has historically been one of the most portable pieces of software in the world, so it’s expected to be portable to other ARM ABIs, although I’m only aware of the EABI…