diff options
author | Alexey Neyman <stilor@att.net> | 2016-10-04 11:43:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-04 11:43:42 -0700 |
commit | 33fccf98382d2c28af8d8530f3b20d76f61b19f8 (patch) | |
tree | 81ad69fc8627842150cfe5b3deb9c4679a5ffc69 /scripts/build/cc | |
parent | 651567ff9093092a7d4aeabec44a55f563c6a231 (diff) | |
parent | 62e136d46d1f1164116dbf0732ef94f9db95fec1 (diff) | |
download | crosstool-ng-33fccf98382d2c28af8d8530f3b20d76f61b19f8.tar.gz crosstool-ng-33fccf98382d2c28af8d8530f3b20d76f61b19f8.tar.bz2 crosstool-ng-33fccf98382d2c28af8d8530f3b20d76f61b19f8.zip |
Merge branch 'master' into x86-musl
Diffstat (limited to 'scripts/build/cc')
-rw-r--r-- | scripts/build/cc/100-gcc.sh | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index 86306440..14edcd4a 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -770,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() { @@ -801,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 } |