From d84501b980b3d89ef84e9c09c29ff4c38d450bb1 Mon Sep 17 00:00:00 2001 From: "Kirill K. Smirnov" Date: Thu, 15 Sep 2016 01:31:45 +0300 Subject: build/glibc: Improve confusing comment Up until cset 4e2227e8a5537a8553c503e55d2cb2190f2a0d2f there was an 'if' statement with a comment. The abovementioned changeset removed the conditional statement but the comment survived. Signed-off-by: Kirill K. Smirnov --- scripts/build/libc/glibc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/build') diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 8027b8f8..5067455f 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -30,7 +30,8 @@ do_libc_get() { do_libc_extract() { CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}" CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" - # Attempt CT_PATCH only if NOT custom + # Custom glibc won't get patched, because CT_GetCustom + # marks custom glibc as patched. CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}" # The configure files may be older than the configure.in files -- cgit v1.2.3 From 651567ff9093092a7d4aeabec44a55f563c6a231 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 22 Sep 2016 17:01:43 -0700 Subject: Add a checkbox for libmpx build. Disable libmpx for musl builds. Signed-off-by: Alexey Neyman --- config/cc/gcc.in | 5 +++++ config/cc/gcc.in.2 | 10 ++++++++++ scripts/build/cc/100-gcc.sh | 9 +++++++++ 3 files changed, 24 insertions(+) (limited to 'scripts/build') diff --git a/config/cc/gcc.in b/config/cc/gcc.in index 101f2b27..9cc903f0 100644 --- a/config/cc/gcc.in +++ b/config/cc/gcc.in @@ -160,6 +160,7 @@ config CC_GCC_5 select CC_GCC_HAS_LNK_HASH_STYLE select CC_GCC_HAS_LIBQUADMATH select CC_GCC_HAS_LIBSANITIZER + select CC_GCC_HAS_LIBMPX select CC_SUPPORT_GOLANG config CC_GCC_5_or_later @@ -178,6 +179,7 @@ config CC_GCC_6 select CC_GCC_HAS_LNK_HASH_STYLE select CC_GCC_HAS_LIBQUADMATH select CC_GCC_HAS_LIBSANITIZER + select CC_GCC_HAS_LIBMPX select CC_SUPPORT_GOLANG config CC_GCC_6_or_later @@ -276,6 +278,9 @@ config CC_GCC_HAS_LIBQUADMATH config CC_GCC_HAS_LIBSANITIZER bool +config CC_GCC_HAS_LIBMPX + bool + if ! CC_GCC_CUSTOM config CC_GCC_VERSION diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2 index c200d22c..b7353dfa 100644 --- a/config/cc/gcc.in.2 +++ b/config/cc/gcc.in.2 @@ -182,6 +182,16 @@ config CC_GCC_LIBSANITIZER The default is 'N'. Say 'Y' if you need it, and report success/failure. +config CC_GCC_LIBMPX + bool + default y + 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 + help + Enable GCC support for Intel Memory Protection Extensions (MPX). + #----------------------------------------------------------------------------- comment "Misc. obscure options." diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index db147287..86306440 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -436,6 +436,7 @@ do_gcc_core_backend() { extra_config+=(--disable-libgomp) extra_config+=(--disable-libmudflap) + extra_config+=(--disable-libmpx) if [ "${CT_CC_GCC_LIBSSP}" = "y" ]; then extra_config+=(--enable-libssp) @@ -904,6 +905,14 @@ do_gcc_backend() { fi fi + if [ "${CT_CC_GCC_HAS_LIBMPX}" = "y" ]; then + if [ "${CT_CC_GCC_LIBMPX}" = "y" ]; then + extra_config+=(--enable-libmpx) + else + extra_config+=(--disable-libmpx) + fi + fi + final_LDFLAGS+=("${ldflags}") # *** WARNING ! *** -- cgit v1.2.3 From 75dee86653f7ca23aac7fcc89c1982a65c6a5c36 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 2 Oct 2016 15:23:53 -0700 Subject: Fix issue #449. After building final gcc, place the libraries in non-sysroot libs into sysroot. Signed-off-by: Alexey Neyman --- scripts/build/cc/100-gcc.sh | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'scripts/build') diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index db147287..5f874f89 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -769,6 +769,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_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() { @@ -800,10 +817,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 } -- cgit v1.2.3 From 96338beecacca6c416cf88558367c61089c8d959 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 2 Oct 2016 18:50:41 -0700 Subject: GCC uses multi_os_dir for libgcc, not multi_dir. Signed-off-by: Alexey Neyman --- scripts/build/cc/100-gcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/build') diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index 5f874f89..b44d85e5 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -778,7 +778,7 @@ gcc_movelibs() { done # Move only files, directories are for other multilibs - gcc_dir="${CT_PREFIX_DIR}/${CT_TARGET}/lib/${multi_dir}" + 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}" -- cgit v1.2.3 From 8121be5b217d1b354db856f8c4ca1b94ce7cffd4 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 19 Sep 2016 18:50:08 -0700 Subject: Fix m68k with uClibc-ng >= 1.0.15. 1.0.15 only kept a single LINUXTHREADS option, and renamed it, making it no longer option-compatible with uClibc. The option for "1.0.14 or later" version of uClibc-ng is not currently used; rename it to "1.0.15 or later" and use it to handle newer uClibc-ng's linuxthreads. m68k happens to be the only sample using linuxthreads. Signed-off-by: Alexey Neyman --- config/libc/uClibc.in | 4 ++-- config/libc/uClibc.in.2 | 4 +++- scripts/build/libc/uClibc.sh | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'scripts/build') diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in index 3a76a426..14564bab 100644 --- a/config/libc/uClibc.in +++ b/config/libc/uClibc.in @@ -78,7 +78,7 @@ choice config LIBC_UCLIBC_NG_V_1_0_17 bool prompt "1.0.17" - select LIBC_UCLIBC_NG_1_0_14_or_later + select LIBC_UCLIBC_NG_1_0_15_or_later config LIBC_UCLIBC_V_0_9_33_2 bool @@ -96,7 +96,7 @@ config LIBC_VERSION endif # ! LIBC_UCLIBC_CUSTOM -config LIBC_UCLIBC_NG_1_0_14_or_later +config LIBC_UCLIBC_NG_1_0_15_or_later bool select LIBC_UCLIBC_NG_1_0_0_or_later diff --git a/config/libc/uClibc.in.2 b/config/libc/uClibc.in.2 index 3a5fe345..dc024201 100644 --- a/config/libc/uClibc.in.2 +++ b/config/libc/uClibc.in.2 @@ -1,6 +1,6 @@ # uClibc second-part option -if THREADS_LT +if THREADS_LT && !LIBC_UCLIBC_NG_1_0_15_or_later choice bool @@ -30,10 +30,12 @@ endchoice endif # THREADS_LT +# uClibc-ng 1.0.15 did away with 2 implementations of linuxthreads config LIBC_UCLIBC_LNXTHRD string default "" if THREADS_NONE default "" if THREADS_NATIVE + default "" if LIBC_UCLIBC_NG_1_0_15_or_later default "old" if LIBC_UCLIBC_LNXTHRD_OLD default "new" if LIBC_UCLIBC_LNXTHRD_NEW diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index 47e135b9..be8d6bf2 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -377,6 +377,11 @@ manage_uClibc_config() { case "${CT_THREADS}:${CT_LIBC_UCLIBC_LNXTHRD}" in none:) ;; + linuxthreads:) + # Newer version of uClibc-ng, no old/new dichotomy + CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}" + CT_KconfigEnableOption "UCLIBC_HAS_LINUXTHREADS" "${dst}" + ;; linuxthreads:old) CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}" CT_KconfigEnableOption "LINUXTHREADS_OLD" "${dst}" -- cgit v1.2.3 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 --- scripts/build/cc/100-gcc.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts/build') diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index 14edcd4a..bab4c7b0 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 v1.2.3 From f4c7688946646bd3be4ee84c694dd987ea344bf6 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 9 Nov 2016 16:46:01 -0800 Subject: Do not run 'make install' in parallel in GCC. Signed-off-by: Alexey Neyman --- scripts/build/cc/100-gcc.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'scripts/build') diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index bab4c7b0..0e0f8ed5 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -696,8 +696,16 @@ do_gcc_core_backend() { CT_DoLog EXTRA "Building ${log_txt}" CT_DoExecLog ALL ${make} ${JOBSFLAGS} ${core_targets_all} + # Do not pass ${JOBSFLAGS} here: recent GCC builds have been failing + # in parallel 'make install' at random locations: libitm, libcilk, + # always for the files that are installed more than once to the same + # location (such as libitm.info). + # The symptom is that the install command fails with "File exists" + # error; running the same command manually succeeds. It looks like + # attempts to remove the destination and re-create it, but another + # install gets in the way. CT_DoLog EXTRA "Installing ${log_txt}" - CT_DoExecLog ALL ${make} ${JOBSFLAGS} ${core_targets_install} + CT_DoExecLog ALL ${make} ${core_targets_install} # Remove the libtool "pseudo-libraries": having them in the installed # tree makes the libtoolized utilities that are built next assume @@ -1128,11 +1136,12 @@ do_gcc_backend() { CT_DoLog EXTRA "Building final gcc compiler" CT_DoExecLog ALL ${make} ${JOBSFLAGS} all + # See the note on issues with parallel 'make install' in GCC above. CT_DoLog EXTRA "Installing final gcc compiler" if [ "${CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES}" = "y" ]; then - CT_DoExecLog ALL ${make} ${JOBSFLAGS} install-strip + CT_DoExecLog ALL ${make} install-strip else - CT_DoExecLog ALL ${make} ${JOBSFLAGS} install + CT_DoExecLog ALL ${make} install fi # Remove the libtool "pseudo-libraries": having them in the installed -- cgit v1.2.3