Skip to content

Commit

Permalink
Fine-tune moving gcc libraries to sysroot.
Browse files Browse the repository at this point in the history
1. Check if anything was installed outside sysroot; on some [baremetal only?]
configurations GCC doesn't install anything to ${CT_PREFIX_DIR}/${CT_TARGET}/lib.
2. We need to create <sysroot>/lib/<multilib> if it doesn't exist
(MUSL only installs in <sysroot>/usr/lib).
3. Do not move the linker scripts; elf2flt expects to find them
in gcc's dir, not sysroot.

Signed-off-by: Alexey Neyman <stilor@att.net>
  • Loading branch information
stilor committed Oct 7, 2016
1 parent 3ec2211 commit 3330ad7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/build/cc/100-gcc.sh
Expand Up @@ -780,8 +780,20 @@ gcc_movelibs() {

# Move only files, directories are for other multilibs
gcc_dir="${CT_PREFIX_DIR}/${CT_TARGET}/lib/${multi_os_dir}"
if [ ! -d "${gcc_dir}" ]; then
# GCC didn't install anything outside of sysroot
return
fi
ls "${gcc_dir}" | while read f; do
case "${f}" in
*.ld)
# Linker scripts remain in GCC's directory; elf2flt insists on
# finding them there.
continue
;;
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}"
fi
done
Expand Down

0 comments on commit 3330ad7

Please sign in to comment.