spack/var/spack/repos/builtin/packages/llvm/llvm12-thread.patch
Toyohisa Kameyama 0c4b56d885
llvm: fix build with Fujitsu compiler, and conflicts gcc@8.4 on aarch64 (#29030)
* llvm: fix build with Fujitsu compiler.

* Add conflict gcc 8.4 and aarch64.

* update conflicts version.

* fix version to apply patch.
2022-03-03 19:50:23 -07:00

32 lines
1.4 KiB
Diff

diff --git a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
index e3c2a580396e..5f76992d193e 100644
--- a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+++ b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -249,3 +249,6 @@ if (NOT LIBOMPTARGET_CUDA_TOOLKIT_ROOT_DIR_PRESET AND
endif()
endif()
endif()
+
+find_package(Threads REQUIRED)
+set(OPENMP_PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
index 15e6c3bbaf1f..3e5a73504a08 100644
--- a/openmp/libomptarget/src/CMakeLists.txt
+++ b/openmp/libomptarget/src/CMakeLists.txt
@@ -30,6 +30,7 @@ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMPTARGET_PROFILING))
add_library(omptarget SHARED ${LIBOMPTARGET_SRC_FILES})
target_link_libraries(omptarget
${CMAKE_DL_LIBS}
+ ${OPENMP_PTHREAD_LIB}
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
else()
set(LLVM_LINK_COMPONENTS
@@ -37,6 +38,7 @@ else()
)
add_llvm_library(omptarget SHARED ${LIBOMPTARGET_SRC_FILES}
LINK_LIBS ${CMAKE_DL_LIBS}
+ ${OPENMP_PTHREAD_LIB}
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports"
)
target_compile_definitions(omptarget PUBLIC OMPTARGET_PROFILE_ENABLED)