commit:     3ab36cc3531af8a39c1b28bc30f8b724b9242949
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 15 12:18:34 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Dec 15 12:48:14 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ab36cc3

toolchain.eclass: don't build with LTO for USE=ada && < gcc-12

There's another -Wlto-type-mismatch issue in GCC 11 with USE=ada and
the patch we used in >=12 doesn't apply cleanly there, not worth spending
the time on for an EOL branch.

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

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

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 4e27cd2fb8f6..55b2127a4f11 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1323,8 +1323,13 @@ toolchain_src_configure() {
        confgcc+=( --enable-lto )
 
        # Build compiler itself using LTO
-       if tc_version_is_at_least 9.1 && _tc_use_if_iuse lto ; then
-               BUILD_CONFIG_TARGETS+=( bootstrap-lto )
+       if tc_use_if_iuse lto ; then
+               # GCC 11 at least has a -Wlto-type-mismatch issue with Ada
+               if ! tc_version_is_at_least 12.1 && is_ada ; then
+                       :;
+               elif tc_version_is_at_least 9.1 ; then
+                       BUILD_CONFIG_TARGETS+=( bootstrap-lto )
+               fi
        fi
 
        if tc_version_is_at_least 12 && _tc_use_if_iuse cet && [[ -z 
${CLANG_DISABLE_CET_HACK} && ${CTARGET} == x86_64-*-gnu* ]] ; then

Reply via email to