commit: 776c012c6e3b6dd66aeeff851aedb48851f93975
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 11 13:20:00 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 11 13:23:05 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=776c012c
toolchain.eclass: wire up libc++ support (!)
Since GCC 14 (*), GCC supports -stdlib=libc++ if --with-gxx-libcxx-include-dir
is passed when configuring it. Pass that to facilitate testing and debugging.
(*) Handling was adjusted in r14-4107-gce7a757fd9ecb9. It existed before
that in r11-6333-g662b9c55cf06d3 but the logic for the configure option
changed substantially in the former commit, and I don't want to test
all branches, so >=14 it is.
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass/toolchain.eclass | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index e9f56450a33e..24464c73c9a6 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1833,6 +1833,11 @@ toolchain_src_configure() {
fi
fi
+ if [[ ${CTARGET} != *-darwin* ]] && tc_version_is_at_least 14.1 ; then
+ # This allows passing -stdlib-=libc++ at runtime.
+ confgcc+=(
--with-gxx-libcxx-include-dir="${ESYSROOT}"/usr/include/c++/v1 )
+ fi
+
# TODO: Ignore RCs here (but TOOLCHAIN_IS_RC isn't yet an eclass var)
if [[ ${PV} == *_p* && -f "${S}"/gcc/doc/gcc.info ]] ; then
# Safeguard against https://gcc.gnu.org/PR106899 being fixed