diff options
author | Alexey Neyman <stilor@att.net> | 2019-02-18 18:22:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-18 18:22:17 (GMT) |
commit | 7d621cd831e4fb015fa151437051192135337006 (patch) | |
tree | 7f1313ccc9112cb0bc1a231a33c5344e54ec2c94 /scripts | |
parent | fb744d81588395a97cee951a151a56501a500e42 (diff) | |
parent | 8a61f74f38e33166f6be0dde0cae82cfe055c3bf (diff) |
Merge pull request #1142 from stilor/rc2-fixes
Fixes for regressions in 1.24.0-rc1
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build/cc/gcc.sh | 33 | ||||
-rw-r--r-- | scripts/build/libc/glibc.sh | 7 | ||||
-rw-r--r-- | scripts/build/libc/mingw-w64.sh | 4 | ||||
-rw-r--r-- | scripts/build/libc/moxiebox.sh | 5 | ||||
-rw-r--r-- | scripts/crosstool-NG.sh | 8 | ||||
-rw-r--r-- | scripts/functions | 16 |
6 files changed, 45 insertions, 28 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 038db38..9ba5982 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -293,8 +293,7 @@ do_gcc_core_backend() { local prefix local complibs local lang_list - local cflags - local cflags_for_build + local cflags cflags_for_build cflags_for_target local ldflags local build_step local log_txt @@ -352,12 +351,6 @@ do_gcc_core_backend() { ;; esac - case "${build_step}" in - core2|gcc_build) - CT_DoLog DEBUG "Copying headers to install area of core C compiler" - CT_DoExecLog ALL cp -a "${CT_HEADERS_DIR}" "${prefix}/${CT_TARGET}/include" - esac - for tmp in ARCH ABI CPU TUNE FPU FLOAT ENDIAN; do eval tmp="\${CT_ARCH_WITH_${tmp}}" if [ -n "${tmp}" ]; then @@ -551,21 +544,35 @@ do_gcc_core_backend() { # We may need to modify host/build CFLAGS separately below cflags_for_build="${CT_CFLAGS_FOR_BUILD}" + cflags="${CT_CFLAGS_FOR_HOST}" + cflags_for_target="${CT_TARGET_CFLAGS}" # Clang's default bracket-depth is 256, and building GCC # requires somewhere between 257 and 512. if [ "${host}" = "${CT_BUILD}" ]; then if ${CT_BUILD}-gcc --version 2>&1 | grep clang; then - cflags="$cflags "-fbracket-depth=512 - cflags_for_build="$cflags_for_build "-fbracket-depth=512 + cflags="$cflags -fbracket-depth=512" + cflags_for_build="$cflags_for_build -fbracket-depth=512" fi else # FIXME we currently don't support clang as host compiler, only as build if ${CT_BUILD}-gcc --version 2>&1 | grep clang; then - cflags_for_build="$cflags_for_build "-fbracket-depth=512 + cflags_for_build="$cflags_for_build -fbracket-depth=512" fi fi + # For non-sysrooted toolchain, GCC doesn't search except at the installation + # prefix; in core-1/2 stage we use a temporary installation prefix - but + # we may have installed something into the final prefix. This is less than ideal: + # in the installation prefix GCC also handles subdirectories for multilibs + # (e.g. first trying ${prefix}/include/${arch-triplet}) but + # we can only pass the top level directory, so non-sysrooted build with libc + # selection that doesn't merge the headers (i.e. musl, uClibc-ng) may not + # work. Better suggestions welcome. + if [ "${CT_USE_SYSROOT}" != "y" ]; then + cflags_for_target="${cflags_for_target} -idirafter ${CT_HEADERS_DIR}" + fi + # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532). # Pass only user-specified CFLAGS/LDFLAGS in CFLAGS_FOR_TARGET/LDFLAGS_FOR_TARGET: during # the build of, for example, libatomic, GCC tried to compile multiple variants for runtime @@ -578,8 +585,8 @@ do_gcc_core_backend() { CXXFLAGS="${cflags}" \ CXXFLAGS_FOR_BUILD="${cflags_for_build}" \ LDFLAGS="${core_LDFLAGS[*]}" \ - CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ - CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ + CFLAGS_FOR_TARGET="${cflags_for_target}" \ + CXXFLAGS_FOR_TARGET="${cflags_for_target}" \ LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \ ${CONFIG_SHELL} \ "${CT_SRC_DIR}/gcc/configure" \ diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 312c88f..aebc898 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -182,9 +182,6 @@ glibc_backend_once() touch config.cache - # Hide host C++ binary from configure - echo "ac_cv_prog_ac_ct_CXX=${CT_TARGET}-g++" >>config.cache - # Until it became explicitly controllable with --enable-stack-protector=..., # configure detected GCC support for -fstack-protector{,-strong} and # tried to enable it in some parts of glibc - which then failed to build. @@ -282,6 +279,10 @@ glibc_backend_once() "${CT_GLIBC_EXTRA_CONFIG_ARRAY[@]}" # build hacks + + # Mask C++ compiler. Glibc 2.29+ attempts to build some tests using gcc++, but + # we haven't built libstdc++ yet. Should really implement #808 after 1.24.0... + extra_make_args+=( CXX= ) case "${CT_ARCH},${CT_ARCH_CPU}" in powerpc,8??) # http://sourceware.org/ml/crossgcc/2008-10/msg00068.html diff --git a/scripts/build/libc/mingw-w64.sh b/scripts/build/libc/mingw-w64.sh index 6e87073..a5b89d1 100644 --- a/scripts/build/libc/mingw-w64.sh +++ b/scripts/build/libc/mingw-w64.sh @@ -220,7 +220,3 @@ mingw_w64_main() CT_EndStep fi } - -mingw_w64_post_cc() { - : -} diff --git a/scripts/build/libc/moxiebox.sh b/scripts/build/libc/moxiebox.sh index f542187..25ef6e7 100644 --- a/scripts/build/libc/moxiebox.sh +++ b/scripts/build/libc/moxiebox.sh @@ -22,7 +22,10 @@ moxiebox_start_files() moxiebox_main() { newlib_main +} +moxiebox_post_cc() +{ CT_DoStep INFO "Installing moxiebox runtime and VM" CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc-moxiebox" @@ -45,7 +48,7 @@ moxiebox_main() CT_DoExecLog CFG ./autogen.sh - # moxiebox build script create symlinks from the installation location to the build + # moxiebox build script creates symlinks from the installation location to the build # directory for the moxiebox library. This seems backwards. Instead, pass the search # as part of the MOX_GCC definition. # moxiebox also depends on the tools being named moxiebox-{gcc,as,ar}. However, failure diff --git a/scripts/crosstool-NG.sh b/scripts/crosstool-NG.sh index b15a488..2e60f20 100644 --- a/scripts/crosstool-NG.sh +++ b/scripts/crosstool-NG.sh @@ -102,6 +102,14 @@ for d in \ esac done +n_open_files=$(ulimit -n) +if [ "${n_open_files}" -lt 2048 ]; then + # Newer ld seems to keep a lot of open file descriptors, hitting the default limit + # (1024) for example during uClibc-ng link. + CT_DoLog WARN "Number of open files ${n_open_files} may not be sufficient to build the toolchain; increasing to 2048" + ulimit -n 2048 +fi + # Where will we work? CT_WORK_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/.build}" CT_BUILD_DIR="${CT_BUILD_TOP_DIR}/build" diff --git a/scripts/functions b/scripts/functions index f71ea04..e577b9d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -283,13 +283,15 @@ CT_DoLog() { _prog_bar[3]='|' indent=$((2*CT_STEP_COUNT)) while read line; do - case "${CT_LOG_SEE_TOOLS_WARN},${line}" in - y,*"warning:"*) cur_L=WARN; cur_l=${CT_LOG_LEVEL_WARN};; - y,*"WARNING:"*) cur_L=WARN; cur_l=${CT_LOG_LEVEL_WARN};; - *"error:"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; - *"Error:"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; - *"make["*"]: ***"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; - *) cur_L="${LEVEL}"; cur_l="${level}";; + case "${CT_LOG_SEE_TOOLS_WARN:-n},${line}" in + y,*[[:space:]][Ww]arning:*|y,[Ww]arning:*|y,*[[:space:]]WARNING:*|y,WARNING:*) + cur_L=WARN; cur_l=${CT_LOG_LEVEL_WARN};; + *[[:space:]][Ee]rror:*|[yn],[Ee]rror:*) + cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; + *"make["*"]: ***"*) + cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; + *) + cur_L="${LEVEL}"; cur_l="${level}";; esac # There will always be a log file (stdout, fd #1), be it /dev/null if [ -n "${CT_LOG_ENABLED}" ]; then |