docs/6 - Toolchain types.txt
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Sat Jan 04 01:02:57 2014 +0100 (2014-01-04)
changeset 3271 c65dc9b98841
parent 2564 5d4e91c0343e
permissions -rw-r--r--
cc/gcc: diable libsanitizer without NPTL

gcc-4.8 comes with a new library to sanitise memory access:
- heap-, stack-, and global-buffer overflow, use-after-free
- data-races between threads

This library requires some _np parts of the API, which are not
implemented in the (old) LinuxThreads, which is still available
in uClibc.

Since NPTL requires a i486 or above, i386 are stuck with using LT,
which precludes building the libsanitizer.

Disable libsanitizer, a bit like libatomic is.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Niels Penneman <niels@penneman.org>
     1 File.........: 6 - Toolchain types.txt
     2 Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.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, targeting 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