1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/docs/6 - Toolchain types.txt Sun Jan 02 22:32:04 2011 +0100
1.3 @@ -0,0 +1,64 @@
1.4 +File.........: 6 - Toolchain types.txt
1.5 +Copyrigth....: (C) 2010 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
1.6 +License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
1.7 +
1.8 +
1.9 +Toolchain types /
1.10 +________________/
1.11 +
1.12 +
1.13 +There are four kinds of toolchains you could encounter.
1.14 +
1.15 +First off, you must understand the following: when it comes to compilers there
1.16 +are up to four machines involved:
1.17 + 1) the machine configuring the toolchain components: the config machine
1.18 + 2) the machine building the toolchain components: the build machine
1.19 + 3) the machine running the toolchain: the host machine
1.20 + 4) the machine the toolchain is generating code for: the target machine
1.21 +
1.22 +We can most of the time assume that the config machine and the build machine
1.23 +are the same. Most of the time, this will be true. The only time it isn't
1.24 +is if you're using distributed compilation (such as distcc). Let's forget
1.25 +this for the sake of simplicity.
1.26 +
1.27 +So we're left with three machines:
1.28 + - build
1.29 + - host
1.30 + - target
1.31 +
1.32 +Any toolchain will involve those three machines. You can be as pretty sure of
1.33 +this as "2 and 2 are 4". Here is how they come into play:
1.34 +
1.35 +1) build == host == target
1.36 + This is a plain native toolchain, targetting the exact same machine as the
1.37 + one it is built on, and running again on this exact same machine. You have
1.38 + to build such a toolchain when you want to use an updated component, such
1.39 + as a newer gcc for example.
1.40 + crosstool-NG calls it "native".
1.41 +
1.42 +2) build == host != target
1.43 + This is a classic cross-toolchain, which is expected to be run on the same
1.44 + machine it is compiled on, and generate code to run on a second machine,
1.45 + the target.
1.46 + crosstool-NG calls it "cross".
1.47 +
1.48 +3) build != host == target
1.49 + Such a toolchain is also a native toolchain, as it targets the same machine
1.50 + as it runs on. But it is build on another machine. You want such a
1.51 + toolchain when porting to a new architecture, or if the build machine is
1.52 + much faster than the host machine.
1.53 + crosstool-NG calls it "cross-native".
1.54 +
1.55 +4) build != host != target
1.56 + This one is called a canadian-toolchain (*), and is tricky. The three
1.57 + machines in play are different. You might want such a toolchain if you
1.58 + have a fast build machine, but the users will use it on another machine,
1.59 + and will produce code to run on a third machine.
1.60 + crosstool-NG calls it "canadian".
1.61 +
1.62 +crosstool-NG can build all these kinds of toolchains (or is aiming at it,
1.63 +anyway!)
1.64 +
1.65 +(*) The term Canadian Cross came about because at the time that these issues
1.66 + were all being hashed out, Canada had three national political parties.
1.67 + http://en.wikipedia.org/wiki/Cross_compiler