LLVM: avoid Fujitsu compiler build fail in llvm17-18 (#43387)
* Avoid Fujitsu compiler Clang Mode options when building LLVM * LLVM: avoid Fujitsu compiler build fail in llvm17-18 * address review comments
This commit is contained in:
parent
d5c8864942
commit
3f2fa256fc
22
var/spack/repos/builtin/packages/llvm/llvm17-18-thread.patch
Normal file
22
var/spack/repos/builtin/packages/llvm/llvm17-18-thread.patch
Normal file
@ -0,0 +1,22 @@
|
||||
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.orig 2024-03-26 14:30:52.000000000 +0900
|
||||
+++ b/openmp/libomptarget/src/CMakeLists.txt 2024-03-26 14:34:02.000000000 +0900
|
||||
@@ -41,5 +41,6 @@
|
||||
|
||||
if (LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
|
||||
target_link_libraries(omptarget PRIVATE
|
||||
+ ${OPENMP_PTHREAD_LIB}
|
||||
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
|
||||
endif()
|
28
var/spack/repos/builtin/packages/llvm/llvm17-fujitsu.patch
Normal file
28
var/spack/repos/builtin/packages/llvm/llvm17-fujitsu.patch
Normal file
@ -0,0 +1,28 @@
|
||||
diff --git a/lldb/include/lldb/Utility/LLDBAssert.h_org b/lldb/include/lldb/Utility/LLDBAssert.h
|
||||
index aeef3e5..2f14ff3 100644
|
||||
--- a/lldb/include/lldb/Utility/LLDBAssert.h_org
|
||||
+++ b/lldb/include/lldb/Utility/LLDBAssert.h
|
||||
@@ -14,7 +14,7 @@
|
||||
#ifndef NDEBUG
|
||||
#define lldbassert(x) assert(x)
|
||||
#else
|
||||
-#if defined(__clang__)
|
||||
+#if defined(__clang__) && !defined(__CLANG_FUJITSU)
|
||||
// __FILE_NAME__ is a Clang-specific extension that functions similar to
|
||||
// __FILE__ but only renders the last path component (the filename) instead of
|
||||
// an invocation dependent full path to that file.
|
||||
|
||||
diff --git runtimes/CMakeLists.txt_org runtimes/CMakeLists.txt
|
||||
--- a/runtimes/CMakeLists.txt_org
|
||||
+++ b/runtimes/CMakeLists.txt
|
||||
@@ -6,2 +6,2 @@
|
||||
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
|
||||
NO_POLICY_SCOPE)
|
||||
|
||||
+string(REPLACE "-Nclang" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
+string(REPLACE "-Nnofjprof" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
+string(REPLACE "-Nfjprof" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
+
|
||||
project(Runtimes C CXX ASM)
|
||||
|
||||
list(INSERT CMAKE_MODULE_PATH 0
|
@ -539,6 +539,10 @@ class Llvm(CMakePackage, CudaPackage):
|
||||
# avoid build failed with Fujitsu compiler
|
||||
patch("llvm13-fujitsu.patch", when="@13 %fj")
|
||||
|
||||
# avoid build failed with Fujitsu compiler since llvm17
|
||||
patch("llvm17-fujitsu.patch", when="@17: %fj")
|
||||
patch("llvm17-18-thread.patch", when="@17:18 %fj")
|
||||
|
||||
# patch for missing hwloc.h include for libompd
|
||||
# see https://reviews.llvm.org/D123888
|
||||
patch(
|
||||
|
Loading…
Reference in New Issue
Block a user