commit:     c1d510a5f4fcd477e94fb429925321d65d3b80ed
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  9 14:29:43 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug  9 14:29:43 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1d510a5

toolchain.eclass: tidy up src_test a bit more, another tweak

* Disable -fno-semantic-interposition for tests as ASAN + contract violation
  checks rely on it

* Consolidate the appends vs. filters

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/toolchain.eclass | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 89af435dfbf6..2acade8e4ca8 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1926,23 +1926,25 @@ toolchain_src_test() {
        (
                # Unexpected warnings confuse the tests.
                filter-flags -W*
-
                # May break parsing.
                filter-flags '-fdiagnostics-color=*' '-fdiagnostics-urls=*'
-
                # Gentoo QA flags which don't belong in tests
                filter-flags -frecord-gcc-switches
                filter-flags '-Wl,--defsym=__gentoo_check_ldflags__=0'
+               # Go doesn't support this and causes noisy warnings
+               filter-flags -Wbuiltin-declaration-mismatch
+               # The ASAN tests at least need LD_PRELOAD and the contract
+               # tests.
+               filter-flags -fno-semantic-interposition
 
                # Workaround our -Wformat-security default which breaks
                # various tests as it adds unexpected warning output.
-               # (Only for C/C++ here to avoid noise for Fortran.)
-               append-cflags -Wno-format-security -Wno-format
-               append-cxxflags -Wno-format-security -Wno-format
+               append-flags -Wno-format-security -Wno-format
                # Workaround our -Wtrampolines default which breaks
                # tests too.
                append-flags -Wno-trampolines
-
+               # A handful of Ada (and objc++?) tests need an executable stack
+               append-ldflags -Wl,--no-warn-execstack
                # Avoid confusing tests like Fortran/C interop ones where
                # CFLAGS are used.
                append-flags -Wno-complain-wrong-lang
@@ -1957,11 +1959,6 @@ toolchain_src_test() {
                # TODO: This isn't ideal given it obv. affects codegen
                # and we want to be sure it works.
                append-flags -fno-stack-clash-protection
-               # A handful of Ada (and objc++?) tests need an executable stack
-               append-ldflags -Wl,--no-warn-execstack
-
-               # Go doesn't support this and causes noisy warnings
-               filter-flags -Wbuiltin-declaration-mismatch
 
                # configure defaults to '-O2 -g' and some tests expect it
                # accordingly.

Reply via email to