Set ALL_TARGET_CFLAGS initially for !MULTILIB

Fixes #1107.

Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
Alexey Neyman 2018-12-06 21:01:45 -08:00
parent f8874f447e
commit 9d2a5f8413
2 changed files with 29 additions and 24 deletions

View File

@ -158,29 +158,31 @@ cc_gcc_multilib_housekeeping() {
CT_IterateMultilibs evaluate_multilib_cflags evaluate_cflags CT_IterateMultilibs evaluate_multilib_cflags evaluate_cflags
# Filtering out some of the options provided in CT-NG config. Then *prepend* if [ -n "${CT_MULTILIB}" ]; then
# them to CT_TARGET_CFLAGS, like scripts/crosstool-NG.sh does. Zero out # Filtering out some of the options provided in CT-NG config. Then *prepend*
# the stashed MULTILIB flags so that we don't process them again in the passes # them to CT_TARGET_CFLAGS, like scripts/crosstool-NG.sh does. Zero out
# that follow. # the stashed MULTILIB flags so that we don't process them again in the passes
CT_DoLog DEBUG "Configured target CFLAGS: '${CT_ARCH_TARGET_CFLAGS_MULTILIB}'" # that follow.
ml_unknown= # Pass through anything we don't know about CT_DoLog DEBUG "Configured target CFLAGS: '${CT_ARCH_TARGET_CFLAGS_MULTILIB}'"
for f in ${CT_ARCH_TARGET_CFLAGS_MULTILIB}; do ml_unknown= # Pass through anything we don't know about
eval ml=\$ml_`cc_gcc_classify_opt ${f}` for f in ${CT_ARCH_TARGET_CFLAGS_MULTILIB}; do
if [ "${ml}" != "seen" ]; then eval ml=\$ml_`cc_gcc_classify_opt ${f}`
new_cflags="${new_cflags} ${f}" if [ "${ml}" != "seen" ]; then
fi new_cflags="${new_cflags} ${f}"
done fi
CT_DoLog DEBUG "Filtered target CFLAGS: '${new_cflags}'" done
CT_EnvModify CT_ALL_TARGET_CFLAGS "${new_cflags} ${CT_TARGET_CFLAGS}" CT_DoLog DEBUG "Filtered target CFLAGS: '${new_cflags}'"
CT_EnvModify CT_ARCH_TARGET_CFLAGS_MULTILIB "" CT_EnvModify CT_ALL_TARGET_CFLAGS "${new_cflags} ${CT_TARGET_CFLAGS}"
CT_EnvModify CT_ARCH_TARGET_CFLAGS_MULTILIB ""
# Currently, the only LDFLAGS are endianness-related # Currently, the only LDFLAGS are endianness-related
CT_DoLog DEBUG "Configured target LDFLAGS: '${CT_ARCH_TARGET_LDFLAGS_MULTILIB}'" CT_DoLog DEBUG "Configured target LDFLAGS: '${CT_ARCH_TARGET_LDFLAGS_MULTILIB}'"
if [ "${ml_endian}" != "seen" ]; then if [ "${ml_endian}" != "seen" ]; then
CT_EnvModify CT_ALL_TARGET_LDFLAGS "${CT_ARCH_TARGET_LDFLAGS_MULTILIB} ${CT_TARGET_LDFLAGS}" CT_EnvModify CT_ALL_TARGET_LDFLAGS "${CT_ARCH_TARGET_LDFLAGS_MULTILIB} ${CT_TARGET_LDFLAGS}"
CT_EnvModify CT_ARCH_TARGET_LDFLAGS_MULTILIB "" CT_EnvModify CT_ARCH_TARGET_LDFLAGS_MULTILIB ""
fi
CT_DoLog DEBUG "Filtered target LDFLAGS: '${CT_ARCH_TARGET_LDFLAGS_MULTILIB}'"
fi fi
CT_DoLog DEBUG "Filtered target LDFLAGS: '${CT_ARCH_TARGET_LDFLAGS_MULTILIB}'"
} }
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1189,11 +1189,14 @@ CT_DoBuildTargetTuple() {
# Instead, save them into a different variable here. Then, after the first # Instead, save them into a different variable here. Then, after the first
# core pass, we'll know which of them vary with multilibs (i.e. must be # core pass, we'll know which of them vary with multilibs (i.e. must be
# filtered out). # filtered out).
if [ "${CT_MULTILIB}" = "y" ]; then if [ -n "${CT_MULTILIB}" ]; then
CT_ARCH_TARGET_CFLAGS_MULTILIB="${CT_ARCH_TARGET_CFLAGS}" CT_ARCH_TARGET_CFLAGS_MULTILIB="${CT_ARCH_TARGET_CFLAGS}"
CT_ARCH_TARGET_CFLAGS= CT_ARCH_TARGET_CFLAGS=
CT_ARCH_TARGET_LDFLAGS_MULTILIB="${CT_ARCH_TARGET_LDFLAGS}" CT_ARCH_TARGET_LDFLAGS_MULTILIB="${CT_ARCH_TARGET_LDFLAGS}"
CT_ARCH_TARGET_LDFLAGS= CT_ARCH_TARGET_LDFLAGS=
else
CT_ALL_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_TARGET_CFLAGS}"
CT_ALL_TARGET_LDFLAGS="${CT_ARCH_TARGET_LDFLAGS} ${CT_TARGET_LDFLAGS}"
fi fi
} }
@ -1990,7 +1993,7 @@ CT_PackageRun()
src_release mirrors archive_filename archive_dirname archive_formats signature_format \ src_release mirrors archive_filename archive_dirname archive_formats signature_format \
src_devel devel_vcs devel_url devel_branch devel_revision devel_subdir devel_bootstrap \ src_devel devel_vcs devel_url devel_branch devel_revision devel_subdir devel_bootstrap \
src_custom custom_location patch_order; do src_custom custom_location patch_order; do
CT_DoLog DEBUG "Package iterator: set ${v}=\${CT_${use}_${v^^}}" eval "CT_DoLog DEBUG \"Package iterator: set ${v}='\${CT_${use}_${v^^}}'\""
eval "local ${v}=\${CT_${use}_${v^^}}" eval "local ${v}=\${CT_${use}_${v^^}}"
done done
@ -2015,7 +2018,7 @@ CT_PackageRun()
for v in devel_branch devel_revision basename src_dir pkg_dir; do for v in devel_branch devel_revision basename src_dir pkg_dir; do
eval "[ \"\${${v}}\" != \"\${CT_${use}_${v^^}}\" ] || continue" eval "[ \"\${${v}}\" != \"\${CT_${use}_${v^^}}\" ] || continue"
eval "CT_${use}_${v^^}=\${${v}}" eval "CT_${use}_${v^^}=\${${v}}"
eval "CT_DoLog DEBUG \"Override CT_${use}_${v^^}=\${CT_${use}_${v^^}}\"" eval "CT_DoLog DEBUG \"Package iterator: override CT_${use}_${v^^}=\${CT_${use}_${v^^}}\""
done done
} }