commit:     02646f0fae039a2badd932f8fb607557c29def18
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 21 22:26:24 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 22:26:54 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02646f0f

toolchain.eclass: swap LTO order to allow override

Otherwise we can't disable it for some targets. Followup to
970f09a488afafe27152255d4343ff59acc94415.

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

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

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index a973e7fd7811..8ffdd9e26f1e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1090,6 +1090,14 @@ toolchain_src_configure() {
                confgcc+=( --enable-libstdcxx-time )
        fi
 
+       # This only controls whether the compiler *supports* LTO, not whether
+       # it's *built using* LTO. Hence we do it without a USE flag.
+       if tc_version_is_at_least 4.6 ; then
+               confgcc+=( --enable-lto )
+       elif tc_version_is_at_least 4.5 ; then
+               confgcc+=( --disable-lto )
+       fi
+
        # Build compiler itself using LTO
        if tc_version_is_at_least 9.1 && _tc_use_if_iuse lto ; then
                build_config_targets+=( bootstrap-lto )
@@ -1489,14 +1497,6 @@ toolchain_src_configure() {
                confgcc+=( $(use_with zstd) )
        fi
 
-       # This only controls whether the compiler *supports* LTO, not whether
-       # it's *built using* LTO. Hence we do it without a USE flag.
-       if tc_version_is_at_least 4.6 ; then
-               confgcc+=( --enable-lto )
-       elif tc_version_is_at_least 4.5 ; then
-               confgcc+=( --disable-lto )
-       fi
-
        # graphite was added in 4.4 but we only support it in 6.5+ due to 
external
        # library issues. bug #448024, bug #701270
        if tc_version_is_at_least 6.5 && in_iuse graphite ; then

Reply via email to