# HG changeset patch # User Remy Bohmer # Date 1270839877 -7200 # Node ID e6a9a4f36645319fe8c6a930ef50d1b59852ed6f # Parent 21907956ad1658ce5764eede89f08f9c147e295a 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 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 diff -r 21907956ad16 -r e6a9a4f36645 scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Tue Apr 20 10:06:04 2010 +0200 +++ b/scripts/build/cc/gcc.sh Fri Apr 09 21:04:37 2010 +0200 @@ -238,7 +238,19 @@ install_rules="install-gcc" fi - CT_DoExecLog ALL make ${PARALLELMFLAGS} -C gcc ${libgcc_rule} + # On bare metal and canadian build the host-compiler is used when + # actually the build-system compiler is required. Choose the correct + # compilers for canadian build and use the defaults on other + # configurations. + if [ "${CT_BARE_METAL},${CT_CANADIAN}" = "y,y" ]; then + repair_cc="CC_FOR_BUILD=${CT_BUILD}-gcc \ + GCC_FOR_TARGET=${CT_TARGET}-gcc" + else + repair_cc="" + fi + + CT_DoExecLog ALL make ${PARALLELMFLAGS} -C gcc ${libgcc_rule} \ + ${repair_cc} sed -r -i -e 's@-lc@@g' gcc/${libgcc_rule} else # build_libgcc build_rules="all-gcc"