diff options
author | Alexey Neyman <stilor@att.net> | 2017-03-09 19:07:21 -0800 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2017-03-09 19:07:21 -0800 |
commit | fc2f73fc083085b6daeae1d1cbe7b380aaff3783 (patch) | |
tree | 248bae6002c808b9bc13f0d5c410bbf647398d20 /scripts/build/cc | |
parent | 6f226b5efecc8f15f1adc56be2fa41377523d3a5 (diff) | |
download | crosstool-ng-fc2f73fc083085b6daeae1d1cbe7b380aaff3783.tar.gz crosstool-ng-fc2f73fc083085b6daeae1d1cbe7b380aaff3783.tar.bz2 crosstool-ng-fc2f73fc083085b6daeae1d1cbe7b380aaff3783.zip |
When moving gcc libs, prefer the same directory as libc
If libc ended up in a directory other than /lib, place GCC's libs
in that directory as well.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/cc')
-rw-r--r-- | scripts/build/cc/100-gcc.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index 56517d38..6cdcb31c 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -790,7 +790,7 @@ do_gcc_for_build() { gcc_movelibs() { local multi_flags multi_dir multi_os_dir multi_root multi_index multi_count - local gcc_dir + local gcc_dir dst_dir for arg in "$@"; do eval "${arg// /\\ }" @@ -803,6 +803,15 @@ gcc_movelibs() { # GCC didn't install anything outside of sysroot return fi + # Depending on the selected libc, we may or may not have the ${multi_os_dir_gcc} + # created by libc installation. If we do, use it. If we don't, use ${multi_os_dir} + # to avoid creating an otherwise empty directory. + dst_dir="${multi_root}/lib/${multi_os_dir_gcc}" + if [ ! -d "${dst_dir}" ]; then + dst_dir="${multi_root}/lib/${multi_os_dir}" + fi + CT_SanitizeVarDir dst_dir gcc_dir + ls "${gcc_dir}" | while read f; do case "${f}" in *.ld) @@ -812,8 +821,8 @@ gcc_movelibs() { ;; esac if [ -f "${gcc_dir}/${f}" ]; then - CT_DoExecLog ALL mkdir -p "${multi_root}/lib/${multi_os_dir}" - CT_DoExecLog ALL mv "${gcc_dir}/${f}" "${multi_root}/lib/${multi_os_dir}/${f}" + CT_DoExecLog ALL mkdir -p "${dst_dir}" + CT_DoExecLog ALL mv "${gcc_dir}/${f}" "${dst_dir}/${f}" fi done } |