docs/6 - Toolchain types.txt
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jul 12 23:52:24 2011 +0200 (2011-07-12)
branch1.11
changeset 2558 b7317d2fe0e9
child 2563 e17f35b05539
permissions -rw-r--r--
scripts, cc/gcc: do not fail on existing symlinks or build.log

If the user builds a toolchain over an existing one, so, without removing
CT_PREFIX_DIR, the build fails as the symlinks already exist, as does the
build.log.

This can also happen (for build.log) if the user first ran in download-
or extract-only.

Patch (with no SoB) originally from:
Phil Wilshire <phil.wilshire@overturenetworks.com>

Modified by me as it did not apply cleanly.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 1ebc2248cc60230cd53ff94ae8f8f1e3261461a3)
     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