commit:     78d0452d48984926f5ebc5102dfc1539a264f3bc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 12 16:54:51 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 17:51:46 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78d0452d

sys-libs/libomp: Block calling nvptx-arch

Block calling nvptx-arch as well as amdgpu-arch.  Upstream is using
this executable to determine the GPU architecture and implement
the "native" card selection.  However, it is called even if the option
is not used (we are following upstream in building support for all GPUs)
and it may cause sandbox violations.

Closes: https://bugs.gentoo.org/926613
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-libs/libomp/libomp-18.1.0.ebuild             | 6 ++++--
 sys-libs/libomp/libomp-19.0.0.9999.ebuild        | 6 ++++--
 sys-libs/libomp/libomp-19.0.0_pre20240309.ebuild | 6 ++++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/sys-libs/libomp/libomp-18.1.0.ebuild 
b/sys-libs/libomp/libomp-18.1.0.ebuild
index b61e605f2abd..79490dd692cb 100644
--- a/sys-libs/libomp/libomp-18.1.0.ebuild
+++ b/sys-libs/libomp/libomp-18.1.0.ebuild
@@ -114,8 +114,6 @@ multilib_src_configure() {
                -DLIBOMP_INSTALL_ALIASES=OFF
                # disable unnecessary hack copying stuff back to srcdir
                -DLIBOMP_COPY_EXPORTS=OFF
-               # prevent trying to access the GPU
-               -DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND
        )
 
        if [[ ${build_omptarget} == ON ]]; then
@@ -130,6 +128,10 @@ multilib_src_configure() {
                        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+=(

diff --git a/sys-libs/libomp/libomp-19.0.0.9999.ebuild 
b/sys-libs/libomp/libomp-19.0.0.9999.ebuild
index ce432b31535d..a40d0aed1c41 100644
--- a/sys-libs/libomp/libomp-19.0.0.9999.ebuild
+++ b/sys-libs/libomp/libomp-19.0.0.9999.ebuild
@@ -113,8 +113,6 @@ multilib_src_configure() {
                -DLIBOMP_INSTALL_ALIASES=OFF
                # disable unnecessary hack copying stuff back to srcdir
                -DLIBOMP_COPY_EXPORTS=OFF
-               # prevent trying to access the GPU
-               -DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND
        )
 
        if [[ ${build_omptarget} == ON ]]; then
@@ -129,6 +127,10 @@ multilib_src_configure() {
                        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+=(

diff --git a/sys-libs/libomp/libomp-19.0.0_pre20240309.ebuild 
b/sys-libs/libomp/libomp-19.0.0_pre20240309.ebuild
index ce432b31535d..a40d0aed1c41 100644
--- a/sys-libs/libomp/libomp-19.0.0_pre20240309.ebuild
+++ b/sys-libs/libomp/libomp-19.0.0_pre20240309.ebuild
@@ -113,8 +113,6 @@ multilib_src_configure() {
                -DLIBOMP_INSTALL_ALIASES=OFF
                # disable unnecessary hack copying stuff back to srcdir
                -DLIBOMP_COPY_EXPORTS=OFF
-               # prevent trying to access the GPU
-               -DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND
        )
 
        if [[ ${build_omptarget} == ON ]]; then
@@ -129,6 +127,10 @@ multilib_src_configure() {
                        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+=(

Reply via email to