cc/gcc: use proper host compiler for canadian bare-metal
authorRemy Bohmer <linux@bohmer.net>
Fri Apr 09 21:04:37 2010 +0200 (2010-04-09)
changeset 1926e6a9a4f36645
parent 1925 21907956ad16
child 1927 aede9b9a2ffa
cc/gcc: use proper host compiler for canadian bare-metal

While compiling a canadian toolchain for host=mingw32, build=linux,
target=m68k-elf the build fails because in this step of the gcc build
the Host compiler is used in this stage with the build-flags for the
build system. This results in an error where the header <sys/wait.h>
cannot be found.
This problem happens at least in the GCC-4.3.x and GCC-4.4.x range.

This is solved by passing the proper compilers on the Make cmd-line

Signed-off-by: Remy Bohmer <linux@bohmer.net>
scripts/build/cc/gcc.sh
     1.1 --- a/scripts/build/cc/gcc.sh	Tue Apr 20 10:06:04 2010 +0200
     1.2 +++ b/scripts/build/cc/gcc.sh	Fri Apr 09 21:04:37 2010 +0200
     1.3 @@ -238,7 +238,19 @@
     1.4              install_rules="install-gcc"
     1.5          fi
     1.6  
     1.7 -        CT_DoExecLog ALL make ${PARALLELMFLAGS} -C gcc ${libgcc_rule}
     1.8 +        # On bare metal and canadian build the host-compiler is used when
     1.9 +        # actually the build-system compiler is required. Choose the correct
    1.10 +        # compilers for canadian build and use the defaults on other
    1.11 +        # configurations.
    1.12 +        if [ "${CT_BARE_METAL},${CT_CANADIAN}" = "y,y" ]; then
    1.13 +            repair_cc="CC_FOR_BUILD=${CT_BUILD}-gcc \
    1.14 +                       GCC_FOR_TARGET=${CT_TARGET}-gcc"
    1.15 +        else
    1.16 +            repair_cc=""
    1.17 +        fi
    1.18 +
    1.19 +        CT_DoExecLog ALL make ${PARALLELMFLAGS} -C gcc ${libgcc_rule} \
    1.20 +                              ${repair_cc}
    1.21          sed -r -i -e 's@-lc@@g' gcc/${libgcc_rule}
    1.22      else # build_libgcc
    1.23              build_rules="all-gcc"