From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1625438-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 F1F331581F0
	for <garchives@archives.gentoo.org>; Sat, 27 Apr 2024 10:42:47 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 6E787E29F1;
	Sat, 27 Apr 2024 10:42:46 +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) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 4DC8BE29EF
	for <gentoo-commits@lists.gentoo.org>; Sat, 27 Apr 2024 10:42:46 +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 2FED7340813
	for <gentoo-commits@lists.gentoo.org>; Sat, 27 Apr 2024 10:42:45 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 8EC11170E
	for <gentoo-commits@lists.gentoo.org>; Sat, 27 Apr 2024 10:42: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: <1714214541.81b1f0d8cf5e39e0250b73208705aaf4b3367042.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-19.0.0.9999.ebuild
X-VCS-Directories: sys-libs/libomp/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 81b1f0d8cf5e39e0250b73208705aaf4b3367042
X-VCS-Branch: master
Date: Sat, 27 Apr 2024 10:42: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: 5e8b0998-78aa-4e1c-8e00-897147921948
X-Archives-Hash: eab1569b58afc290c821e7d910d5f72d

commit:     81b1f0d8cf5e39e0250b73208705aaf4b3367042
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 27 10:33:27 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 27 10:42:21 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81b1f0d8

sys-libs/libomp: Remove offloading support

Upstream split offload into a separate component, that does not work
when built standalone, and building via runtimes is entirely broken.

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

 sys-libs/libomp/libomp-19.0.0.9999.ebuild | 76 +------------------------------
 1 file changed, 2 insertions(+), 74 deletions(-)

diff --git a/sys-libs/libomp/libomp-19.0.0.9999.ebuild b/sys-libs/libomp/libomp-19.0.0.9999.ebuild
index a40d0aed1c41..0084c1ccb07c 100644
--- a/sys-libs/libomp/libomp-19.0.0.9999.ebuild
+++ b/sys-libs/libomp/libomp-19.0.0.9999.ebuild
@@ -4,18 +4,14 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
-inherit flag-o-matic cmake-multilib linux-info llvm.org llvm-utils
-inherit python-single-r1 toolchain-funcs
+inherit flag-o-matic cmake-multilib linux-info llvm.org python-single-r1
 
 DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
 HOMEPAGE="https://openmp.llvm.org"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0/${LLVM_SOABI}"
-IUSE="
-	+debug gdb-plugin hwloc offload ompt test
-	llvm_targets_AMDGPU llvm_targets_NVPTX
-"
+IUSE="+debug gdb-plugin hwloc ompt test"
 REQUIRED_USE="
 	gdb-plugin? ( ${PYTHON_REQUIRED_USE} )
 "
@@ -24,11 +20,6 @@ RESTRICT="!test? ( test )"
 RDEPEND="
 	gdb-plugin? ( ${PYTHON_DEPS} )
 	hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] )
-	offload? (
-		dev-libs/libffi:=[${MULTILIB_USEDEP}]
-		~sys-devel/llvm-${PV}[${MULTILIB_USEDEP}]
-		llvm_targets_AMDGPU? ( dev-libs/rocr-runtime:= )
-	)
 "
 # tests:
 # - dev-python/lit provides the test runner
@@ -39,11 +30,6 @@ DEPEND="
 "
 BDEPEND="
 	dev-lang/perl
-	offload? (
-		llvm_targets_AMDGPU? ( sys-devel/clang )
-		llvm_targets_NVPTX? ( sys-devel/clang )
-		virtual/pkgconfig
-	)
 	test? (
 		${PYTHON_DEPS}
 		$(python_gen_cond_dep '
@@ -56,23 +42,6 @@ BDEPEND="
 LLVM_COMPONENTS=( openmp cmake llvm/include )
 llvm.org_set_globals
 
-kernel_pds_check() {
-	if use kernel_linux && kernel_is -lt 4 15 && kernel_is -ge 4 13; then
-		local CONFIG_CHECK="~!SCHED_PDS"
-		local ERROR_SCHED_PDS="\
-PDS scheduler versions >= 0.98c < 0.98i (e.g. used in kernels >= 4.13-pf11
-< 4.14-pf9) do not implement sched_yield() call which may result in horrible
-performance problems with libomp. If you are using one of the specified
-kernel versions, you may want to disable the PDS scheduler."
-
-		check_extra_config
-	fi
-}
-
-pkg_pretend() {
-	kernel_pds_check
-}
-
 pkg_setup() {
 	if use gdb-plugin || use test; then
 		python-single-r1_pkg_setup
@@ -80,25 +49,12 @@ pkg_setup() {
 }
 
 multilib_src_configure() {
-	use offload && llvm_prepend_path "${LLVM_MAJOR}"
-
 	# LTO causes issues in other packages building, #870127
 	filter-lto
 
 	# 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}"
@@ -107,39 +63,12 @@ multilib_src_configure() {
 		-DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin)
 		-DLIBOMP_OMPT_SUPPORT=$(usex ompt)
 
-		-DOPENMP_ENABLE_LIBOMPTARGET=${build_omptarget}
-
 		# do not install libgomp.so & libiomp5.so aliases
 		-DLIBOMP_INSTALL_ALIASES=OFF
 		# disable unnecessary hack copying stuff back to srcdir
 		-DLIBOMP_COPY_EXPORTS=OFF
 	)
 
-	if [[ ${build_omptarget} == ON ]]; then
-		local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
-		local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
-		mycmakeargs+=(
-			-DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
-			-DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
-		)
-
-		if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then
-			mycmakeargs+=(
-				-DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=$(usex llvm_targets_AMDGPU)
-				-DLIBOMPTARGET_BUILD_CUDA_PLUGIN=$(usex llvm_targets_NVPTX)
-
-				# prevent trying to access the GPU
-				-DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND
-				-DLIBOMPTARGET_NVPTX_ARCH=LIBOMPTARGET_NVPTX_ARCH-NOTFOUND
-			)
-		else
-			mycmakeargs+=(
-				-DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF
-				-DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF
-			)
-		fi
-	fi
-
 	use test && mycmakeargs+=(
 		# this project does not use standard LLVM cmake macros
 		-DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit"
@@ -148,7 +77,6 @@ multilib_src_configure() {
 		-DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")"
 		-DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")"
 	)
-	addpredict /dev/nvidiactl
 	cmake_src_configure
 }