1.1 --- a/scripts/build/cc/gcc.sh Tue Oct 30 00:30:47 2012 +0100
1.2 +++ b/scripts/build/cc/gcc.sh Fri Nov 16 15:25:57 2012 +0100
1.3 @@ -88,6 +88,7 @@
1.4 core_opts+=( "complibs=${CT_BUILDTOOLS_PREFIX_DIR}" )
1.5 core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
1.6 core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.7 + core_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
1.8 core_opts+=( "lang_list=c" )
1.9
1.10 CT_DoStep INFO "Installing pass-1 core C compiler"
1.11 @@ -108,6 +109,7 @@
1.12 core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
1.13 core_opts+=( "complibs=${CT_BUILDTOOLS_PREFIX_DIR}" )
1.14 core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.15 + core_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
1.16 core_opts+=( "lang_list=c" )
1.17
1.18 # Different conditions are at stake here:
1.19 @@ -155,7 +157,8 @@
1.20 # build_libstdcxx : build libstdc++ or not : bool : no
1.21 # build_staticlinked : build statically linked or not : bool : no
1.22 # build_manuals : whether to build manuals or not : bool : no
1.23 -# cflags : host CFLAGS to use : string : (empty)
1.24 +# cflags : cflags to use : string : (empty)
1.25 +# ldflags : ldflags to use : string : (empty)
1.26 # Usage: do_cc_core_backend mode=[static|shared|baremetal] build_libgcc=[yes|no] build_staticlinked=[yes|no]
1.27 do_cc_core_backend() {
1.28 local mode
1.29 @@ -168,6 +171,7 @@
1.30 local complibs
1.31 local lang_list
1.32 local cflags
1.33 + local ldflags
1.34 local tmp
1.35 local -a host_libstdcxx_flags
1.36 local -a extra_config
1.37 @@ -227,6 +231,8 @@
1.38 extra_config+=("--disable-__cxa_atexit")
1.39 fi
1.40
1.41 + core_LDFLAGS+=("${ldflags}")
1.42 +
1.43 # *** WARNING ! ***
1.44 # Keep this full if-else-if-elif-fi-fi block in sync
1.45 # with the same block in do_cc, below.
1.46 @@ -521,6 +527,7 @@
1.47 final_opts+=( "prefix=${CT_PREFIX_DIR}" )
1.48 final_opts+=( "complibs=${CT_HOST_COMPLIBS_DIR}" )
1.49 final_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.50 + final_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
1.51 final_opts+=( "lang_list=$( cc_gcc_lang_list )" )
1.52 if [ "${CT_BUILD_MANUALS}" = "y" ]; then
1.53 final_opts+=( "build_manuals=yes" )
1.54 @@ -553,7 +560,8 @@
1.55 # host : the host we run onto : tuple : (none)
1.56 # prefix : the runtime prefix : dir : (none)
1.57 # complibs : the companion libraries prefix : dir : (none)
1.58 -# cflags : the host CFLAGS : string : (empty)
1.59 +# cflags : cflags to use : string : (empty)
1.60 +# ldflags : ldflags to use : string : (empty)
1.61 # lang_list : the list of languages to build : string : (empty)
1.62 # build_manuals : whether to build manuals or not : bool : no
1.63 do_cc_backend() {
1.64 @@ -561,6 +569,7 @@
1.65 local prefix
1.66 local complibs
1.67 local cflags
1.68 + local ldflags
1.69 local lang_list
1.70 local build_manuals
1.71 local -a host_libstdcxx_flags
1.72 @@ -628,6 +637,8 @@
1.73 fi
1.74 fi
1.75
1.76 + final_LDFLAGS+=("${ldflags}")
1.77 +
1.78 # *** WARNING ! ***
1.79 # Keep this full if-else-if-elif-fi-fi block in sync
1.80 # with the same block in do_cc_core, above.