summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/toolchain.eclass41
1 files changed, 26 insertions, 15 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 550845b7dd47..86a29f5aacb8 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1924,9 +1924,14 @@ toolchain_src_test() {
# Use a subshell to allow meddling with flags just for the testsuite
(
+ # Unexpected warnings confuse the tests.
+ filter-flags -W*
+
# Workaround our -Wformat-security default which breaks
# various tests as it adds unexpected warning output.
- append-flags -Wno-format-security -Wno-format
+ # (Only for C/C++ here to avoid noise for Fortran.)
+ append-cflags -Wno-format-security -Wno-format
+ append-cxxflags -Wno-format-security -Wno-format
# Workaround our -Wtrampolines default which breaks
# tests too.
append-flags -Wno-trampolines
@@ -1948,24 +1953,30 @@ toolchain_src_test() {
filter-flags -Wbuiltin-declaration-mismatch
# TODO: Does this handle s390 (-m31) correctly?
- is_multilib && GCC_TESTS_RUNTESTFLAGS+=" --target_board=unix\{,-m32\}"
-
- GCC_TESTS_RUNTESTFLAGS=(
- "${GCC_TESTS_RUNTESTFLAGS}"
- CFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET:-${CFLAGS}}"
- CXXFLAGS_FOR_TARGET="${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}"
- LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}"
- CFLAGS="${CFLAGS}"
- CXXFLAGS="${CXXFLAGS}"
- FCFLAGS="${FCFLAGS}"
- FFLAGS="${FFLAGS}"
- LDFLAGS="${LDFLAGS}"
- )
+ 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.
nonfatal emake -C "${WORKDIR}"/build -k "${GCC_TESTS_CHECK_TARGET}" \
- RUNTESTFLAGS="${GCC_TESTS_RUNTESTFLAGS[*]}"
+ RUNTESTFLAGS=" \
+ ${GCC_TESTS_RUNTESTFLAGS} \
+ CFLAGS_FOR_TARGET='${CFLAGS_FOR_TARGET:-${CFLAGS}}' \
+ CXXFLAGS_FOR_TARGET='${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}' \
+ LDFLAGS_FOR_TARGET='${LDFLAGS_FOR_TARGET:-${LDFLAGS}}' \
+ CFLAGS='${CFLAGS}' \
+ CXXFLAGS='${CXXFLAGS}' \
+ FCFLAGS='${FCFLAGS}' \
+ FFLAGS='${FFLAGS}' \
+ LDFLAGS='${LDFLAGS}' \
+ " \
+ CFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET:-${CFLAGS}}" \
+ CXXFLAGS_FOR_TARGET="${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}" \
+ LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}" \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ FCFLAGS="${FCFLAGS}" \
+ FFLAGS="${FFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
)
# Produce an updated failure manifest.