From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1649771-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 08FEE1581C1
	for <garchives@archives.gentoo.org>; Thu,  4 Jul 2024 19:08:05 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 21CE7E2A16;
	Thu,  4 Jul 2024 19:08:04 +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 pigeon.gentoo.org (Postfix) with ESMTPS id D37E9E2A16
	for <gentoo-commits@lists.gentoo.org>; Thu,  4 Jul 2024 19:08:03 +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))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id E5DCB3406BF
	for <gentoo-commits@lists.gentoo.org>; Thu,  4 Jul 2024 19:08:02 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 824C03A1
	for <gentoo-commits@lists.gentoo.org>; Thu,  4 Jul 2024 19:08:01 +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: <1720120030.de01d97d992ee06fa23ed0938cfd32cc0ea34493.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/clang-common/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-devel/clang-common/clang-common-17.0.6-r6.ebuild sys-devel/clang-common/clang-common-18.1.8-r1.ebuild sys-devel/clang-common/clang-common-18.1.8.ebuild sys-devel/clang-common/clang-common-19.0.0.9999.ebuild sys-devel/clang-common/clang-common-19.0.0_pre20240630.ebuild
X-VCS-Directories: sys-devel/clang-common/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: de01d97d992ee06fa23ed0938cfd32cc0ea34493
X-VCS-Branch: master
Date: Thu,  4 Jul 2024 19:08:01 +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: c1acb6e6-7a72-476f-8957-815d131e0ac7
X-Archives-Hash: c19b3a9c9e66fc758f42052dcd0c5a54

commit:     de01d97d992ee06fa23ed0938cfd32cc0ea34493
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Thu Jul  4 03:44:33 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul  4 19:07:10 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de01d97d

sys-devel/clang-common: add -Xarch_host for hardening flags to fix HIP compilation

Fixes USE=hardened errors like:
`error: reference to __host__ function '__glibcxx_assert_fail' in __host__ __device__ function`

Closes: https://bugs.gentoo.org/935314
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/37420
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../{clang-common-18.1.8.ebuild => clang-common-17.0.6-r6.ebuild}   | 6 ++----
 .../{clang-common-18.1.8.ebuild => clang-common-18.1.8-r1.ebuild}   | 4 ++--
 sys-devel/clang-common/clang-common-19.0.0.9999.ebuild              | 4 ++--
 sys-devel/clang-common/clang-common-19.0.0_pre20240630.ebuild       | 4 ++--
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/sys-devel/clang-common/clang-common-18.1.8.ebuild b/sys-devel/clang-common/clang-common-17.0.6-r6.ebuild
similarity index 98%
copy from sys-devel/clang-common/clang-common-18.1.8.ebuild
copy to sys-devel/clang-common/clang-common-17.0.6-r6.ebuild
index b7d4720e0e22..f90ed723d7b0 100644
--- a/sys-devel/clang-common/clang-common-18.1.8.ebuild
+++ b/sys-devel/clang-common/clang-common-17.0.6-r6.ebuild
@@ -244,17 +244,15 @@ src_install() {
 	#endif
 	EOF
 
-	# TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
-	# non-hardened?
 	if use hardened ; then
 		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
 			# Options below are conditional on USE=hardened.
-			-D_GLIBCXX_ASSERTIONS
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
 
 			# Analogue to GLIBCXX_ASSERTIONS
 			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
 			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+			-Xarch_host -D_LIBCPP_ENABLE_ASSERTIONS=1
 		EOF
 
 		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die

diff --git a/sys-devel/clang-common/clang-common-18.1.8.ebuild b/sys-devel/clang-common/clang-common-18.1.8-r1.ebuild
similarity index 98%
rename from sys-devel/clang-common/clang-common-18.1.8.ebuild
rename to sys-devel/clang-common/clang-common-18.1.8-r1.ebuild
index b7d4720e0e22..303f8001a6c8 100644
--- a/sys-devel/clang-common/clang-common-18.1.8.ebuild
+++ b/sys-devel/clang-common/clang-common-18.1.8-r1.ebuild
@@ -249,12 +249,12 @@ src_install() {
 	if use hardened ; then
 		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
 			# Options below are conditional on USE=hardened.
-			-D_GLIBCXX_ASSERTIONS
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
 
 			# Analogue to GLIBCXX_ASSERTIONS
 			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
 			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
 		EOF
 
 		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die

diff --git a/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild b/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild
index f260391ba4ab..090a45690818 100644
--- a/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild
+++ b/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild
@@ -248,12 +248,12 @@ src_install() {
 	if use hardened ; then
 		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
 			# Options below are conditional on USE=hardened.
-			-D_GLIBCXX_ASSERTIONS
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
 
 			# Analogue to GLIBCXX_ASSERTIONS
 			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
 			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
 		EOF
 
 		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die

diff --git a/sys-devel/clang-common/clang-common-19.0.0_pre20240630.ebuild b/sys-devel/clang-common/clang-common-19.0.0_pre20240630.ebuild
index f260391ba4ab..090a45690818 100644
--- a/sys-devel/clang-common/clang-common-19.0.0_pre20240630.ebuild
+++ b/sys-devel/clang-common/clang-common-19.0.0_pre20240630.ebuild
@@ -248,12 +248,12 @@ src_install() {
 	if use hardened ; then
 		cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
 			# Options below are conditional on USE=hardened.
-			-D_GLIBCXX_ASSERTIONS
+			-Xarch_host -D_GLIBCXX_ASSERTIONS
 
 			# Analogue to GLIBCXX_ASSERTIONS
 			# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
 			# https://libcxx.llvm.org/Hardening.html#using-hardened-mode
-			-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+			-Xarch_host -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
 		EOF
 
 		cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die