From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1480080-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 43C1715800F
	for <garchives@archives.gentoo.org>; Tue, 24 Jan 2023 13:34:48 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 748B1E086A;
	Tue, 24 Jan 2023 13:34:47 +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 5AA75E086A
	for <gentoo-commits@lists.gentoo.org>; Tue, 24 Jan 2023 13:34:47 +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 74C86340E1E
	for <gentoo-commits@lists.gentoo.org>; Tue, 24 Jan 2023 13:34:46 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id BFAF084D
	for <gentoo-commits@lists.gentoo.org>; Tue, 24 Jan 2023 13:34:43 +0000 (UTC)
From: "Michał Górny" <mgorny@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, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1674567280.39f548062f464b50387eb0d52db49956ccff5245.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libomp/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-libs/libomp/libomp-16.0.0.9999.ebuild
X-VCS-Directories: sys-libs/libomp/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 39f548062f464b50387eb0d52db49956ccff5245
X-VCS-Branch: master
Date: Tue, 24 Jan 2023 13:34:43 +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: 7a614324-6175-4f08-bab0-4dba4752778a
X-Archives-Hash: 094a6c98fa1f4e158edf651122623b72

commit:     39f548062f464b50387eb0d52db49956ccff5245
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 24 13:32:20 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jan 24 13:34:40 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39f54806

sys-libs/libomp: Stop enabling libomptarget on 32-bit arches in 16.x

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-libs/libomp/libomp-16.0.0.9999.ebuild | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/sys-libs/libomp/libomp-16.0.0.9999.ebuild b/sys-libs/libomp/libomp-16.0.0.9999.ebuild
index b9c22f965396..971931877b19 100644
--- a/sys-libs/libomp/libomp-16.0.0.9999.ebuild
+++ b/sys-libs/libomp/libomp-16.0.0.9999.ebuild
@@ -4,7 +4,8 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{9..11} )
-inherit flag-o-matic cmake-multilib linux-info llvm llvm.org python-single-r1
+inherit flag-o-matic cmake-multilib linux-info llvm llvm.org
+inherit python-single-r1 toolchain-funcs
 
 DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
 HOMEPAGE="https://openmp.llvm.org"
@@ -86,6 +87,17 @@ multilib_src_configure() {
 	# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
 	use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
 
+	local build_omptarget=OFF
+	# upstream disallows building libomptarget when sizeof(void*) != 8
+	if use offload &&
+		"$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null \
+		<<-EOF &>/dev/null
+			int test[sizeof(void *) == 8 ? 1 : -1];
+		EOF
+	then
+		build_omptarget=ON
+	fi
+
 	local libdir="$(get_libdir)"
 	local mycmakeargs=(
 		-DOPENMP_LIBDIR_SUFFIX="${libdir#lib}"
@@ -94,7 +106,7 @@ multilib_src_configure() {
 		-DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin)
 		-DLIBOMP_OMPT_SUPPORT=$(usex ompt)
 
-		-DOPENMP_ENABLE_LIBOMPTARGET=$(usex offload)
+		-DOPENMP_ENABLE_LIBOMPTARGET=${build_omptarget}
 
 		# do not install libgomp.so & libiomp5.so aliases
 		-DLIBOMP_INSTALL_ALIASES=OFF
@@ -102,7 +114,7 @@ multilib_src_configure() {
 		-DLIBOMP_COPY_EXPORTS=OFF
 	)
 
-	if use offload; then
+	if [[ ${build_omptarget} == ON ]]; then
 		if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then
 			mycmakeargs+=(
 				-DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=$(usex llvm_targets_AMDGPU)