commit:     564b130fd1bc8a35ac4d673d5211654c49af3fda
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 10 22:55:34 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Apr 10 22:57:21 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=564b130f

toolchain.eclass: use upstream default checking for pre/non-released compilers

Note that this only affects actually-non-released compilers like GCC 13
at this point in time and *not* snapshots from the stable branches.

Upstream default to more checking (asserts/runtime integrity checks) when
'gcc/DEV-PHASE' contains 'experimental'. Copy that and defer to the configure.ac
default when it does.

The practical upshot of this is that we go from --enable-checking=release
for GCC 13 to --enable-checking=yes,extra.

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

 eclass/toolchain.eclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 6a04366bcc1e..0a5e2e1e50aa 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1069,9 +1069,12 @@ toolchain_src_configure() {
        # Use the default ("release") checking because upstream usually neglects
        # to test "disabled" so it has a history of breaking. bug #317217
        if in_iuse debug ; then
-               # The "release" keyword is new to 4.0. bug #551636
-               local off=$(tc_version_is_at_least 4.0 && echo release || echo 
no)
-               confgcc+=( --enable-checking="${GCC_CHECKS_LIST:-$(usex debug 
yes ${off})}" )
+               # Non-released versions get extra checks, follow configure.ac's 
default to for those.
+               if ! grep -q "experimental" gcc/DEV-PHASE ; then
+                       # The "release" keyword is new to 4.0. bug #551636
+                       local off=$(tc_version_is_at_least 4.0 && echo release 
|| echo no)
+                       confgcc+=( --enable-checking="${GCC_CHECKS_LIST:-$(usex 
debug yes ${off})}" )
+               fi
        fi
 
        # Branding

Reply via email to