From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1726657-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id A2FEB1582EF
	for <garchives@archives.gentoo.org>; Tue, 11 Mar 2025 13:23:29 +0000 (UTC)
Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	(Authenticated sender: relay-lists.gentoo.org@gentoo.org)
	by smtp.gentoo.org (Postfix) with ESMTPSA id 8E7EA343157
	for <garchives@archives.gentoo.org>; Tue, 11 Mar 2025 13:23:29 +0000 (UTC)
Received: from bobolink.gentoo.org (localhost [127.0.0.1])
	by bobolink.gentoo.org (Postfix) with ESMTP id B0A521103C7;
	Tue, 11 Mar 2025 13:23:25 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by bobolink.gentoo.org (Postfix) with ESMTPS id AA2831103C7
	for <gentoo-commits@lists.gentoo.org>; Tue, 11 Mar 2025 13:23:25 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 5D599343106
	for <gentoo-commits@lists.gentoo.org>; Tue, 11 Mar 2025 13:23:25 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id BBA6228AE
	for <gentoo-commits@lists.gentoo.org>; Tue, 11 Mar 2025 13:23:23 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1741699385.776c012c6e3b6dd66aeeff851aedb48851f93975.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
X-VCS-Repository: repo/gentoo
X-VCS-Files: eclass/toolchain.eclass
X-VCS-Directories: eclass/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 776c012c6e3b6dd66aeeff851aedb48851f93975
X-VCS-Branch: master
Date: Tue, 11 Mar 2025 13:23:23 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 37270051-1ce8-47a2-8119-fae1491ff4b6
X-Archives-Hash: 18e95050c8d36b3faf5e405abb56244d

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