summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-03-10 03:07:21 (GMT)
committerAlexey Neyman <stilor@att.net>2017-03-10 03:07:21 (GMT)
commitfc2f73fc083085b6daeae1d1cbe7b380aaff3783 (patch)
tree248bae6002c808b9bc13f0d5c410bbf647398d20 /scripts/build
parent6f226b5efecc8f15f1adc56be2fa41377523d3a5 (diff)
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')
-rw-r--r--scripts/build/cc/100-gcc.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index 56517d3..6cdcb31 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
}