yann@2076: File.........: 6 - Toolchain types.txt yann@2908: Copyright....: (C) 2010 Yann E. MORIN yann@2076: License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5 yann@2076: yann@2076: yann@2076: Toolchain types / yann@2076: ________________/ yann@2076: yann@2076: yann@2076: There are four kinds of toolchains you could encounter. yann@2076: yann@2076: First off, you must understand the following: when it comes to compilers there yann@2076: are up to four machines involved: yann@2076: 1) the machine configuring the toolchain components: the config machine yann@2076: 2) the machine building the toolchain components: the build machine yann@2076: 3) the machine running the toolchain: the host machine yann@2076: 4) the machine the toolchain is generating code for: the target machine yann@2076: yann@2076: We can most of the time assume that the config machine and the build machine yann@2076: are the same. Most of the time, this will be true. The only time it isn't yann@2076: is if you're using distributed compilation (such as distcc). Let's forget yann@2076: this for the sake of simplicity. yann@2076: yann@2076: So we're left with three machines: yann@2076: - build yann@2076: - host yann@2076: - target yann@2076: yann@2076: Any toolchain will involve those three machines. You can be as pretty sure of yann@2076: this as "2 and 2 are 4". Here is how they come into play: yann@2076: yann@2076: 1) build == host == target antony@2564: This is a plain native toolchain, targeting the exact same machine as the yann@2076: one it is built on, and running again on this exact same machine. You have yann@2076: to build such a toolchain when you want to use an updated component, such yann@2076: as a newer gcc for example. yann@2076: crosstool-NG calls it "native". yann@2076: yann@2076: 2) build == host != target yann@2076: This is a classic cross-toolchain, which is expected to be run on the same yann@2076: machine it is compiled on, and generate code to run on a second machine, yann@2076: the target. yann@2076: crosstool-NG calls it "cross". yann@2076: yann@2076: 3) build != host == target yann@2076: Such a toolchain is also a native toolchain, as it targets the same machine yann@2076: as it runs on. But it is build on another machine. You want such a yann@2076: toolchain when porting to a new architecture, or if the build machine is yann@2076: much faster than the host machine. yann@2076: crosstool-NG calls it "cross-native". yann@2076: yann@2076: 4) build != host != target yann@2076: This one is called a canadian-toolchain (*), and is tricky. The three yann@2076: machines in play are different. You might want such a toolchain if you yann@2076: have a fast build machine, but the users will use it on another machine, yann@2076: and will produce code to run on a third machine. yann@2076: crosstool-NG calls it "canadian". yann@2076: yann@2076: crosstool-NG can build all these kinds of toolchains (or is aiming at it, yann@2076: anyway!) yann@2076: yann@2076: (*) The term Canadian Cross came about because at the time that these issues yann@2076: were all being hashed out, Canada had three national political parties. yann@2076: http://en.wikipedia.org/wiki/Cross_compiler