summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-09-30 02:25:23 +0100
committerSam James <sam@gentoo.org>2024-09-30 02:51:44 +0100
commitea474da34fe1f904936f0f6b6e52d91364c36c95 (patch)
treef5d549fd9ee0fc9e45476c65203532eb32195d4c /eclass
parenttoolchain.eclass: check CXXFLAGS too in -march=native sanity check (diff)
downloadgentoo-ea474da34fe1f904936f0f6b6e52d91364c36c95.tar.gz
gentoo-ea474da34fe1f904936f0f6b6e52d91364c36c95.tar.bz2
gentoo-ea474da34fe1f904936f0f6b6e52d91364c36c95.zip
toolchain.eclass: unset _GLIBCXX_ASSERTIONS for stage1 with D bootstrap
When bootstrapping D for >= GCC 12 - where we enable _GLIBCXX_ASSERTIONS by default for USE=hardened - using GCC 11, we run into trouble where an implementation detail of _GLIBCXX_ASSERTIONS changed: see PR104807, r12-7504-gd3a757af21ac33, and r12-7522-g4cb935cb69f120. Workaround this by just disabling _GLIBCXX_ASSERTIONS for the stage 1 compiler (where it's not particularly important anyway) when USE=hardened and we're building D. We could make this more conditional if needed but I don't think it's worth it. In fact, maybe we should do this unconditionally for a minor speed boost in building. Bug: https://gcc.gnu.org/PR104807 Bug: https://bugs.gentoo.org/940470 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/toolchain.eclass9
1 files changed, 9 insertions, 0 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index d6445ea3227e..b563277e90b1 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2029,6 +2029,15 @@ gcc_do_make() {
BOOT_LDFLAGS=${BOOT_LDFLAGS-"${abi_ldflags} ${LDFLAGS}"}
LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}"
+ # If we need to in future, we could really simplify this
+ # to just be unconditional for stage1. It doesn't really
+ # matter there. If we want to go in the other direction
+ # and make this more conditional, we could check if
+ # the bootstrap compiler is < GCC 12. See bug #940470.
+ if _tc_use_if_iuse d && use hardened ; then
+ STAGE1_CXXFLAGS+=" -U_GLIBCXX_ASSERTIONS"
+ fi
+
emakeargs+=(
STAGE1_CFLAGS="${STAGE1_CFLAGS}"
STAGE1_CXXFLAGS="${STAGE1_CXXFLAGS}"