From 2091c5dd2dc01d7462ced6a8617d1f5227764f1b Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 28 Nov 2016 22:47:42 -0800 Subject: Pass FOR_BUILD flags when building the pass-1/2 core GCC. Current build passes {CFLAGS,LDFLAGS}_FOR_HOST - which breaks canadian cross (e.g. tried building for x86_64-unknown-linux-uclibc host). This dates back to the days of yore when CFLAGS were set directly in the do_gcc_core_backend (and that function is used as the final gcc's backend). do_gcc_core_backend is now passed with CFLAGS/LDFLAGS to use, so let the pass-1/pass-2/final-for-build steps pass the appropriate flags. Signed-off-by: Alexey Neyman diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index dfdb7f9..b0b713d 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -260,8 +260,8 @@ do_gcc_core_pass_1() { core_opts+=( "host=${CT_BUILD}" ) core_opts+=( "complibs=${CT_BUILDTOOLS_PREFIX_DIR}" ) core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" ) - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) - core_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" ) + core_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" ) + core_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" ) core_opts+=( "lang_list=c" ) core_opts+=( "build_step=core1" ) @@ -286,8 +286,8 @@ do_gcc_core_pass_2() { core_opts+=( "host=${CT_BUILD}" ) core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" ) core_opts+=( "complibs=${CT_BUILDTOOLS_PREFIX_DIR}" ) - core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) - core_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" ) + core_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" ) + core_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" ) core_opts+=( "lang_list=c" ) core_opts+=( "build_step=core2" ) @@ -742,9 +742,8 @@ do_gcc_for_build() { local -a build_final_opts local build_final_backend - # In case we're canadian or cross-native, it seems that a - # real, complete compiler is needed?!? WTF? Sigh... - # Otherwise, there is nothing to do. + # If native or simple cross toolchain is being built, then build==host; + # nothing to do. case "${CT_TOOLCHAIN_TYPE}" in native|cross) return 0;; esac @@ -752,6 +751,8 @@ do_gcc_for_build() { build_final_opts+=( "host=${CT_BUILD}" ) build_final_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" ) build_final_opts+=( "complibs=${CT_BUILDTOOLS_PREFIX_DIR}" ) + build_final_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" ) + build_final_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" ) build_final_opts+=( "lang_list=$( cc_gcc_lang_list )" ) build_final_opts+=( "build_step=gcc_build" ) if [ "${CT_BARE_METAL}" = "y" ]; then -- cgit v0.10.2-6-g49f6