commit:     2add8e9e5a9a837954f6cc4dbbbe72f448b636a8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  3 14:04:08 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb  3 14:06:40 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2add8e9e

toolchain.eclass: don't take shortcut for non-GCC bootstrap compiler

We're fragile for stage0 so if we're not building using GCC, use -O0. The use
of regular CFLAGS/CXXFLAGS there should be seen as a bonus as it has some
caveats. Best to play it safe to avoid confusing hard-to-diagnose differences
later on.

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

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 1679a3d3a366..4cf76229cf88 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1712,7 +1712,7 @@ gcc_do_make() {
                # The last known issues are with < GCC 4.9 or so, but it's 
easier
                # to keep this bound somewhat fresh just to avoid problems. 
Ultimately,
                # using not-O0 is just a build-time speed improvement anyway.
-               if tc-is-gcc && ver_test $(gcc-fullversion) -lt 10 ; then
+               if ! tc-is-gcc || ver_test $(gcc-fullversion) -lt 10 ; then
                        STAGE1_CFLAGS="-O0"
                fi
 

Reply via email to