commit:     90cadf879253a7ef6b439f7a51809f0b0b835693
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 11 08:38:44 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 11 08:39:03 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90cadf87

go-env.eclass: refine filter-lto workaround for checking GCCs

We want to cover unreleased GCC too as it'll have the same (or same enough)
level of checking/debug assertions for the purposes of this bug) problem.

Bug: https://bugs.gentoo.org/912152
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/go-env.eclass | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index 11fdf943e774..b2b240b5ef29 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -1,4 +1,4 @@
-# Copyright 2023-2024 Gentoo Authors
+# Copyright 2023-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: go-env.eclass
@@ -40,7 +40,13 @@ go-env_set_compile_environment() {
        use x86 && export GO386=$(go-env_go386)
 
        # XXX: Hack for checking ICE (bug #912152, gcc PR113204)
-       has_version -b "sys-devel/gcc[debug]" && filter-lto
+       if tc-is-gcc ; then
+               # For either USE=debug or an unreleased compiler, non-default
+               # checking will trigger.
+               if has_version -b "sys-devel/gcc[debug]" || [[ 
$(gcc-minor-version) -eq 0 ]] ; then
+                       filter-lto
+               fi
+       fi
 
        export CGO_CFLAGS="${CGO_CFLAGS:-$CFLAGS}"
        export CGO_CPPFLAGS="${CGO_CPPFLAGS:-$CPPFLAGS}"

Reply via email to