From 3330ad719720905ed2a901ec26a90bcad9d32748 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 5 Oct 2016 12:34:01 -0700 Subject: Fine-tune moving gcc libraries to sysroot. 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 /lib/ if it doesn't exist (MUSL only installs in /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 diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index 14edcd4..bab4c7b 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -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 -- cgit v0.10.2-6-g49f6 From 339b83c3939296e54f5366439a19861372bad9b9 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 5 Oct 2016 13:05:44 -0700 Subject: MINGW doesn't like libmpx either. Signed-off-by: Alexey Neyman diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2 index b7353df..2c5d45e 100644 --- a/config/cc/gcc.in.2 +++ b/config/cc/gcc.in.2 @@ -188,7 +188,8 @@ config CC_GCC_LIBMPX prompt "Compile libmpx" depends on CC_GCC_HAS_LIBMPX depends on ARCH_x86 - depends on !LIBC_musl # MUSL does not define libc types that GCC requires + # MUSL does not define libc types that GCC requires. Mingw lacks certain headers. + depends on !LIBC_musl && ! LIBC_mingw help Enable GCC support for Intel Memory Protection Extensions (MPX). -- cgit v0.10.2-6-g49f6