# HG changeset patch # User "Yann E. MORIN" # Date 1314126686 -7200 # Node ID f176fee535a0f3fec9c00f0d2c4831bc8e6d8639 # Parent a59712c236df9e7d0fddbc908ae3c6f0303a6d49 cc/gcc: add 'cflags' paramater to the core backend As the core backend is used to generate the bare-metal compiler, we need to pass it the host CFLAGS. Signed-off-by: "Yann E. MORIN" diff -r a59712c236df -r f176fee535a0 scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Sun Jul 17 18:10:53 2011 +0200 +++ b/scripts/build/cc/gcc.sh Tue Aug 23 21:11:26 2011 +0200 @@ -70,6 +70,7 @@ core_opts+=( "host=${CT_HOST}" ) core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" ) + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) ;; ,y,*) ;; @@ -79,6 +80,7 @@ core_opts+=( "host=${CT_HOST}" ) core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" ) + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) ;; *) ;; @@ -109,6 +111,7 @@ core_opts+=( "build_libstdcxx=yes" ) core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) core_opts+=( "prefix=${CT_PREFIX_DIR}" ) + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then core_opts+=( "build_staticlinked=yes" ) fi @@ -122,6 +125,7 @@ core_opts+=( "build_libgcc=yes" ) core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) core_opts+=( "prefix=${CT_CC_CORE_SHARED_PREFIX_DIR}" ) + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) ;; ,,win32) do_core=y @@ -130,6 +134,7 @@ core_opts+=( "build_libgcc=yes" ) core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" ) + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) ;; *) do_core=y @@ -137,6 +142,7 @@ core_opts+=( "host=${CT_HOST}" ) core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" ) + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then core_opts+=( "build_libgcc=yes" ) fi @@ -159,6 +165,7 @@ # - where to find the companion libs (prefix) : complibs= (no default value) # - the prefix to install into (directory) : prefix= (no default value) # - the machine we will run on (tuple) : host= (no default tuple) +# - the CFLAGS to use : cflags= (empty) # Usage: do_cc_core_backend mode=[static|shared|baremetal] build_libgcc=[yes|no] build_staticlinked=[yes|no] do_cc_core_backend() { local mode @@ -170,6 +177,7 @@ local prefix local complibs local lang_opt + local cflags local tmp local -a host_libstdcxx_flags local -a extra_config @@ -358,7 +366,7 @@ # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532) CT_DoExecLog CFG \ CC_FOR_BUILD="${CT_BUILD}-gcc" \ - CFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CFLAGS="${cflags}" \ LDFLAGS="${core_LDFLAGS[*]}" \ "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \ --build=${CT_BUILD} \