diff --git a/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass b/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass index c7c366a37a..ac236f3127 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass @@ -1214,7 +1214,14 @@ toolchain_src_configure() { # - https://git.musl-libc.org/cgit/musl/tree/INSTALL # - bug #704784 # - https://gcc.gnu.org/PR93157 - [[ ${CTARGET} == powerpc64-*-musl ]] && confgcc+=( --with-abi=elfv2 ) + # musl additionally does not support libquadmath. See: + # - https://gcc.gnu.org/PR116007 + [[ ${CTARGET} == powerpc64-*-musl ]] && confgcc+=( + --with-abi=elfv2 + --disable-libquadmath + --disable-libquadmath-support + --with-long-double-128=no + ) if in_iuse ieee-long-double; then # musl requires 64-bit long double, not IBM double-double or IEEE quad. @@ -1654,9 +1661,6 @@ gcc_do_filter_flags() { # New in GCC 14. filter-flags -Walloc-size - else - # Makes things painfully slow and no real benefit for the compiler. - append-flags $(test-flags-CC -fno-harden-control-flow-redundancy) fi # Please use USE=lto instead (bug #906007). @@ -1894,7 +1898,6 @@ gcc_do_make() { #---->> src_test <<---- # TODO: add JIT testing -# TODO: add multilib testing toolchain_src_test() { # GCC's testsuite is a special case. # @@ -1917,11 +1920,79 @@ toolchain_src_test() { local -x LD_PRELOAD= # Controls running expensive tests in e.g. the torture testsuite. + # Note that 'TEST', not 'TESTS', is correct here as it's a GCC + # testsuite variable, not ours. local -x GCC_TEST_RUN_EXPENSIVE=1 - # nonfatal here as we die if the comparison below fails. Also, note that - # the exit code of targets other than 'check' may be unreliable. - nonfatal emake -C "${WORKDIR}"/build -k "${GCC_TESTS_CHECK_TARGET}" RUNTESTFLAGS="${GCC_TESTS_RUNTESTFLAGS}" + # Use a subshell to allow meddling with flags just for the testsuite + ( + # Workaround our -Wformat-security default which breaks + # various tests as it adds unexpected warning output. + GCC_TESTS_CFLAGS+=" -Wno-format-security -Wno-format" + GCC_TESTS_CXXFLAGS+=" -Wno-format-security -Wno-format" + + # Workaround our -Wtrampolines default which breaks + # tests too. + GCC_TESTS_CFLAGS+=" -Wno-trampolines" + GCC_TESTS_CXXFLAGS+=" -Wno-trampolines" + # A handful of Ada (and objc++?) tests need an executable stack + GCC_TESTS_LDFLAGS+=" -Wl,--no-warn-execstack" + # Avoid confusing tests like Fortran/C interop ones where + # CFLAGS are used. + GCC_TESTS_CFLAGS+=" -Wno-complain-wrong-lang" + GCC_TESTS_CXXFLAGS+=" -Wno-complain-wrong-lang" + + # Issues with Ada tests: + # gnat.dg/align_max.adb + # gnat.dg/trampoline4.adb + # + # A handful of Ada tests use -fstack-check and conflict + # with -fstack-clash-protection. + # + # TODO: This isn't ideal given it obv. affects codegen + # and we want to be sure it works. + GCC_TESTS_CFLAGS+=" -fno-stack-clash-protection" + GCC_TESTS_CXXFLAGS+=" -fno-stack-clash-protection" + + # configure defaults to '-O2 -g' and some tests expect it + # accordingly. + GCC_TESTS_CFLAGS+=" -g" + + # TODO: Does this handle s390 (-m31) correctly? + # TODO: What if there are multiple ABIs like x32 too? + # XXX: Disabled until validate_failures.py can handle 'variants' + # XXX: https://gcc.gnu.org/PR116260 + #is_multilib && GCC_TESTS_RUNTESTFLAGS+=" --target_board=unix{,-m32}" + + # nonfatal here as we die if the comparison below fails. Also, note that + # the exit code of targets other than 'check' may be unreliable. + # + # CFLAGS and so on are repeated here because of tests vs building test + # deps like libbacktrace. + # + # TODO: Should we try pass in the regular user flags for the non-RUNTESTFLAGS + # instances below for building e.g. libbacktrace? + nonfatal emake -C "${WORKDIR}"/build -k "${GCC_TESTS_CHECK_TARGET}" \ + RUNTESTFLAGS=" \ + ${GCC_TESTS_RUNTESTFLAGS} \ + CFLAGS_FOR_TARGET='${GCC_TESTS_CFLAGS_FOR_TARGET:-${GCC_TESTS_CFLAGS}}' \ + CXXFLAGS_FOR_TARGET='${GCC_TESTS_CXXFLAGS_FOR_TARGET:-${GCC_TESTS_CXXFLAGS}}' \ + LDFLAGS_FOR_TARGET='${TEST_LDFLAGS_FOR_TARGET:-${GCC_TESTS_LDFLAGS}}' \ + CFLAGS='${GCC_TESTS_CFLAGS}' \ + CXXFLAGS='${GCC_TESTS_CXXFLAGS}' \ + FCFLAGS='${GCC_TESTS_FCFLAGS}' \ + FFLAGS='${GCC_TESTS_FFLAGS}' \ + LDFLAGS='${GCC_TESTS_LDFLAGS}' \ + " \ + CFLAGS_FOR_TARGET="${GCC_TESTS_CFLAGS_FOR_TARGET:-${GCC_TESTS_CFLAGS}}" \ + CXXFLAGS_FOR_TARGET="${GCC_TESTS_CXXFLAGS_FOR_TARGET:-${GCC_TESTS_CXXFLAGS}}" \ + LDFLAGS_FOR_TARGET="${GCC_TESTS_LDFLAGS_FOR_TARGET:-${GCC_TESTS_LDFLAGS}}" \ + CFLAGS="${GCC_TESTS_CFLAGS}" \ + CXXFLAGS="${GCC_TESTS_CXXFLAGS}" \ + FCFLAGS="${GCC_TESTS_FCFLAGS}" \ + FFLAGS="${GCC_TESTS_FFLAGS}" \ + LDFLAGS="${GCC_TESTS_LDFLAGS}" + ) # Produce an updated failure manifest. einfo "Generating a new failure manifest ${T}/${CHOST}.xfail" @@ -1975,7 +2046,7 @@ toolchain_src_test() { eerror "GCC_TESTS_IGNORE_NO_BASELINE is set, ignoring test result and creating a new baseline..." elif [[ -n ${GCC_TESTS_REGEN_BASELINE} ]] ; then eerror "GCC_TESTS_REGEN_BASELINE is set, ignoring test result and creating using a new baseline..." - elif [[ ${ret} != 0 ]]; then + elif [[ ${ret} != 0 ]] ; then eerror "(Set GCC_TESTS_IGNORE_NO_BASELINE=1 to make this non-fatal and generate a baseline.)" die "Tests failed (failures occurred with no reference data)" fi