summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
authorDmitry Pankratov <dp@ubiquitech.com>2016-11-11 20:03:11 (GMT)
committerDmitry Pankratov <dp@ubiquitech.com>2016-11-11 20:03:11 (GMT)
commit0d17d26005efbd5d6157df0f68a26c738c385ed2 (patch)
tree9c25ccb481bd4b58e54c692403d9c49402f09d98 /scripts/build
parent34ca68e3b076f4a7eea78aa46215fa50dfb1e322 (diff)
parent5ebbb52be04e42bbd1c28b903eba642bebaeb1b6 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/cc/100-gcc.sh65
-rw-r--r--scripts/build/libc/glibc.sh3
-rw-r--r--scripts/build/libc/uClibc.sh5
3 files changed, 67 insertions, 6 deletions
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index db14728..0e0f8ed 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)
@@ -695,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
@@ -769,6 +778,35 @@ 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_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
+}
+
#------------------------------------------------------------------------------
# Build final gcc to run on host
do_gcc_for_host() {
@@ -800,10 +838,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
}
@@ -904,6 +950,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 ! ***
@@ -1082,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
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 8027b8f..5067455 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
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh
index 47e135b..be8d6bf 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}"