summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMikael Simberg <mikael.simberg@iki.fi>2022-09-29 15:41:59 +0200
committerGitHub <noreply@github.com>2022-09-29 06:41:59 -0700
commita78462988bac0152b2a23c0a56b5016c050b1564 (patch)
treeef1d35819a0dd9d1e3a44b08520c257eae83e50f /var
parenta0147a1f073bd526f0c7c65d47cb66c6a91ec9a9 (diff)
downloadspack-a78462988bac0152b2a23c0a56b5016c050b1564.tar.gz
spack-a78462988bac0152b2a23c0a56b5016c050b1564.tar.bz2
spack-a78462988bac0152b2a23c0a56b5016c050b1564.tar.xz
spack-a78462988bac0152b2a23c0a56b5016c050b1564.zip
Add patch to link pthread library for llvm 15 (#32838)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/llvm/llvm15-thread.patch23
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py1
2 files changed, 24 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/llvm15-thread.patch b/var/spack/repos/builtin/packages/llvm/llvm15-thread.patch
new file mode 100644
index 0000000000..cffb559185
--- /dev/null
+++ b/var/spack/repos/builtin/packages/llvm/llvm15-thread.patch
@@ -0,0 +1,23 @@
+diff --git a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+index 1f2a50667c4f..d3ff232f6bd3 100644
+--- a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
++++ b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+@@ -280,4 +280,5 @@ if (NOT LIBOMPTARGET_CUDA_TOOLKIT_ROOT_DIR_PRESET AND
+ endif()
+ endif()
+
+-set(OPENMP_PTHREAD_LIB ${LLVM_PTHREAD_LIB})
++find_package(Threads REQUIRED)
++set(OPENMP_PTHREAD_LIB Threads::Threads)
+diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
+index 071ec61889a2..b782c3b07e6f 100644
+--- a/openmp/libomptarget/src/CMakeLists.txt
++++ b/openmp/libomptarget/src/CMakeLists.txt
+@@ -33,6 +33,7 @@ add_llvm_library(omptarget
+ LINK_LIBS
+ PRIVATE
+ ${CMAKE_DL_LIBS}
++ ${OPENMP_PTHREAD_LIB}
+ "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports"
+ NO_INSTALL_RPATH
+ )
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index cff8f2e758..e8658f61ec 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -360,6 +360,7 @@ class Llvm(CMakePackage, CudaPackage):
# add -lpthread to build OpenMP libraries
patch("llvm13-14-thread.patch", when="@13:14")
+ patch("llvm15-thread.patch", when="@15")
# avoid build failed with Fujitsu compiler
patch("llvm13-fujitsu.patch", when="@13 %fj")