summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-08-23 19:11:26 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-08-23 19:11:26 (GMT)
commit35f50ca6c246554230429ff7b2804719163c68ce (patch)
treeef4e791ffed529622ecdd6f4481334f231d5e7de /scripts
parent6a29db15933293b7c10c89961403ae42b6f84e1f (diff)
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" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/cc/gcc.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index 6fbf5a2..d39b14e 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -70,6 +70,7 @@ do_cc_core_pass_1() {
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 @@ do_cc_core_pass_1() {
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 @@ do_cc_core_pass_2() {
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 @@ do_cc_core_pass_2() {
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 @@ do_cc_core_pass_2() {
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 @@ do_cc_core_pass_2() {
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 @@ do_cc_core_pass_2() {
# - where to find the companion libs (prefix) : complibs=<prefix_dir> (no default value)
# - the prefix to install into (directory) : prefix=<directory> (no default value)
# - the machine we will run on (tuple) : host=<tuple> (no default tuple)
+# - the CFLAGS to use : cflags=<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 @@ do_cc_core_backend() {
local prefix
local complibs
local lang_opt
+ local cflags
local tmp
local -a host_libstdcxx_flags
local -a extra_config
@@ -358,7 +366,7 @@ do_cc_core_backend() {
# 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} \