Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can anyone explain the gcc cross-compiler naming convention?

I have tried to understand the naming conventions behind the gcc cross-compilers, but there seems to be conflicting answers. I have the following three cross-compilers in my system:

  • arm-none-linux-gnueabi (CodeSourcery ARM compiler for linux)
  • arm-none-eabi (CodeSourcery ARM compiler for bare-metal systems)
  • arm-eabi (Android ARM compiler)

When reading through the GNU libtool manual, it specifies the cross-compiler naming convention as:

cpu-vendor-os (os = system / kernel-system)

This does not seem completely accurate with the compilers in my system. Is the information in the GNU manual old, or have the compiler distributors simply stopped following it?

like image 287
Leo Avatar asked Apr 20 '11 13:04

Leo


People also ask

What is GCC cross compiler?

Generally speaking, a cross-compiler is a compiler that runs on platform A (the host), but generates executables for platform B (the target). These two platforms may (but do not need to) differ in CPU, operating system, and/or executable format.

What is cross compiler explain in detail?

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a PC but generates code that runs on an Android smartphone is a cross compiler.

Does GCC support cross compilation?

For instance when installing GCC, the GNU Compiler Collection, we can use --target= target to specify that we want to build GCC as a cross-compiler for target . Mixing --build and --target , we can cross-compile a cross-compiler; such a three-way cross-compilation is known as a Canadian cross.


1 Answers

The naming comes down to this:

arch-vendor-(os-)abi

So for example:

x86_64-w64-mingw32 = x86_64 architecture (=AMD64), w64 (=mingw-w64 as "vendor"), mingw32 (=win32 API as seen by GCC)

i686-pc-msys = 32-bit (pc=generic name) msys binary

i686-unknown-linux-gnu = 32-bit GNU/linux

And your example specifically:

arm-none-linux-gnueabi = ARM architecture, no vendor, linux OS, and the gnueabi ABI.

The arm-eabi is alike you say, used for Android native apps.

One caveat: Debian uses a different naming, just to be difficult, so be careful if you're on a Debian-based system, as they have different names for eg. i686-pc-mingw32.

like image 113
rubenvb Avatar answered Oct 09 '22 00:10

rubenvb