diff options
author | Kirill Smirnov <kirill.k.smirnov@gmail.com> | 2016-10-05 02:59:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-05 02:59:48 +0300 |
commit | c7cb030fd58f7ec468de9693d78b73037091d7e0 (patch) | |
tree | 77975bad1c15352c73620f0c0ab477cc66647555 /scripts/build/cc | |
parent | 8c04681a99e8e61fff2fe631b3124af666b73d02 (diff) | |
parent | 3ec2211548a853203e070af6810f49825ec46a6a (diff) | |
download | crosstool-ng-c7cb030fd58f7ec468de9693d78b73037091d7e0.tar.gz crosstool-ng-c7cb030fd58f7ec468de9693d78b73037091d7e0.tar.bz2 crosstool-ng-c7cb030fd58f7ec468de9693d78b73037091d7e0.zip |
Merge branch 'master' into janitorial
Diffstat (limited to 'scripts/build/cc')
-rw-r--r-- | scripts/build/cc/100-gcc.sh | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index db147287..14edcd4a 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -436,6 +436,7 @@ do_gcc_core_backend() { extra_config+=(--disable-libgomp) extra_config+=(--disable-libmudflap) + extra_config+=(--disable-libmpx) if [ "${CT_CC_GCC_LIBSSP}" = "y" ]; then extra_config+=(--enable-libssp) @@ -769,6 +770,23 @@ do_gcc_for_build() { CT_EndStep } +gcc_movelibs() { + local multi_flags multi_dir multi_os_dir multi_root multi_index multi_count + local gcc_dir + + for arg in "$@"; do + eval "${arg// /\\ }" + done + + # Move only files, directories are for other multilibs + gcc_dir="${CT_PREFIX_DIR}/${CT_TARGET}/lib/${multi_os_dir}" + ls "${gcc_dir}" | while read f; do + if [ -f "${gcc_dir}/${f}" ]; then + CT_DoExecLog ALL mv "${gcc_dir}/${f}" "${multi_root}/lib/${multi_os_dir}/${f}" + fi + done +} + #------------------------------------------------------------------------------ # Build final gcc to run on host do_gcc_for_host() { @@ -800,10 +818,18 @@ do_gcc_for_host() { CT_DoStep INFO "Installing final gcc compiler" CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-gcc-final" - "${final_backend}" "${final_opts[@]}" - CT_Popd + + # GCC installs stuff (including libgcc) into its own /lib dir, + # outside of sysroot, breaking linking with -static-libgcc. + # Fix up by moving the libraries into the sysroot. + if [ "${CT_USE_SYSROOT}" = "y" ]; then + CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-gcc-final-movelibs" + CT_IterateMultilibs gcc_movelibs movelibs + CT_Popd + fi + CT_EndStep } @@ -904,6 +930,14 @@ do_gcc_backend() { fi fi + if [ "${CT_CC_GCC_HAS_LIBMPX}" = "y" ]; then + if [ "${CT_CC_GCC_LIBMPX}" = "y" ]; then + extra_config+=(--enable-libmpx) + else + extra_config+=(--disable-libmpx) + fi + fi + final_LDFLAGS+=("${ldflags}") # *** WARNING ! *** |