docs/6 - Toolchain types.txt
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Mar 28 01:05:18 2011 +0200 (2011-03-28)
changeset 2362 0888065f8c4d
child 2563 e17f35b05539
permissions -rw-r--r--
cc/gcc: cleanup the _or_later logic

So far, we've had a version always select appropriate _or_later option,
which in turn would select all previous _or_later options.

Because the dependencies on companion libs were cumulative, that was
working OK. But the upcoming 4.6 will no longer depend on libelf, so
we can't keep the cumulative scheme we've been using so far.

Have each release family select the corresponding dependencies, instead
of relying on selecting previous _or_later.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 File.........: 6 - Toolchain types.txt
     2 Copyrigth....: (C) 2010 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
     3 License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
     4 
     5 
     6 Toolchain types  /
     7 ________________/
     8 
     9 
    10 There are four kinds of toolchains you could encounter.
    11 
    12 First off, you must understand the following: when it comes to compilers there
    13 are up to four machines involved:
    14   1) the machine configuring the toolchain components: the config machine
    15   2) the machine building the toolchain components:    the build machine
    16   3) the machine running the toolchain:                the host machine
    17   4) the machine the toolchain is generating code for: the target machine
    18 
    19 We can most of the time assume that the config machine and the build machine
    20 are the same. Most of the time, this will be true. The only time it isn't
    21 is if you're using distributed compilation (such as distcc). Let's forget
    22 this for the sake of simplicity.
    23 
    24 So we're left with three machines:
    25  - build
    26  - host
    27  - target
    28 
    29 Any toolchain will involve those three machines. You can be as pretty sure of
    30 this as "2 and 2 are 4". Here is how they come into play:
    31 
    32 1) build == host == target
    33     This is a plain native toolchain, targetting the exact same machine as the
    34     one it is built on, and running again on this exact same machine. You have
    35     to build such a toolchain when you want to use an updated component, such
    36     as a newer gcc for example.
    37     crosstool-NG calls it "native".
    38 
    39 2) build == host != target
    40     This is a classic cross-toolchain, which is expected to be run on the same
    41     machine it is compiled on, and generate code to run on a second machine,
    42     the target.
    43     crosstool-NG calls it "cross".
    44 
    45 3) build != host == target
    46     Such a toolchain is also a native toolchain, as it targets the same machine
    47     as it runs on. But it is build on another machine. You want such a
    48     toolchain when porting to a new architecture, or if the build machine is
    49     much faster than the host machine.
    50     crosstool-NG calls it "cross-native".
    51 
    52 4) build != host != target
    53     This one is called a canadian-toolchain (*), and is tricky. The three
    54     machines in play are different. You might want such a toolchain if you
    55     have a fast build machine, but the users will use it on another machine,
    56     and will produce code to run on a third machine.
    57     crosstool-NG calls it "canadian".
    58 
    59 crosstool-NG can build all these kinds of toolchains (or is aiming at it,
    60 anyway!)
    61 
    62 (*) The term Canadian Cross came about because at the time that these issues
    63     were all being hashed out, Canada had three national political parties.
    64     http://en.wikipedia.org/wiki/Cross_compiler