Quantcast
Channel: User Louis Maddox - Stack Overflow
Viewing all articles
Browse latest Browse all 51

Answer by Louis Maddox for cross-compilation terminologies --- build, host and target

$
0
0

"There are three system names that the build knows about: the machine you are building on (build), the machine that you are building for (host), and the machine that GCC will produce code for (target). When you configure GCC, you specify these with --build=, --host=, and --target="

...

  • If build, host, and target are all the same, this is called a native.
  • If build and host are the same but target is different, this is called a cross.
  • If build, host, and target are all different this is called a canadian (for obscure reasons dealing with Canada’s political party and the background of the person working on the build at that time).
  • If host and target are the same, but build is different, you are using a cross-compiler to build a native for a different system.
    • Some people call this a host-x-host, crossed native, or cross-built native.
  • If build and target are the same, but host is different, you are using a cross compiler to build a cross compiler that produces code for the machine you’re building on.
    • This is rare, so there is no common way of describing it. There is a proposal to call this a crossback.

Source: https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html

Someone already gave an example of the 'Canadian'.

An example of a cross-compilation is that when building sox from source (the Linux sound library) you need to provide 32-bit binaries for the codecs etc. I just came across this situation on a 64-bit machine, and I want to build it for my own use, which means in this case:

  • The build is the host (my machine)
  • The target is a 32-bit system

This is my understanding anyway, I agree this can be a bit confusingly explained, hope this helps :-)


Viewing all articles
Browse latest Browse all 51

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>