rebase of the patches

This commit is contained in:
Sylvestre Ledru 2023-01-26 14:28:19 +01:00
parent 0775511df2
commit 440420db5e

View File

@ -1,11 +1,11 @@
include required runtimes as dependencies to openmp targets to make sure include required runtimes as dependencies to openmp targets to make sure
they are built first when included as part of a runtimes build since openmp they are built first when included as part of a runtimes build since openmp
can depend on them can depend on them
Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/llvm/runtimes/CMakeLists.txt Index: llvm-toolchain-snapshot_17~++20230126021740+85395af27241/llvm/runtimes/CMakeLists.txt
=================================================================== ===================================================================
--- llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f.orig/llvm/runtimes/CMakeLists.txt --- llvm-toolchain-snapshot_17~++20230126021740+85395af27241.orig/llvm/runtimes/CMakeLists.txt
+++ llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/llvm/runtimes/CMakeLists.txt +++ llvm-toolchain-snapshot_17~++20230126021740+85395af27241/llvm/runtimes/CMakeLists.txt
@@ -235,6 +235,7 @@ function(runtime_default_target) @@ -233,6 +233,7 @@ function(runtime_default_target)
-DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED} -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED}
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default} -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default}
-DLLVM_BUILD_TOOLS=${LLVM_BUILD_TOOLS} -DLLVM_BUILD_TOOLS=${LLVM_BUILD_TOOLS}
@ -13,7 +13,7 @@ Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/llvm/runtimes/CM
-DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON
-DCMAKE_ASM_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON
@@ -465,7 +466,7 @@ if(runtimes) @@ -480,7 +481,7 @@ if(runtimes)
# build directory cannot find the C++ headers in certain configurations. # build directory cannot find the C++ headers in certain configurations.
# I need to build a mechanism for runtime projects to provide CMake code # I need to build a mechanism for runtime projects to provide CMake code
# that executes at LLVM configuration time to handle this case. # that executes at LLVM configuration time to handle this case.
@ -22,11 +22,11 @@ Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/llvm/runtimes/CM
# We need to add the runtimes as a dependency because compiler-rt can be # We need to add the runtimes as a dependency because compiler-rt can be
# built as part of runtimes and we need the profile runtime for PGO # built as part of runtimes and we need the profile runtime for PGO
add_dependencies(clang-bootstrap-deps runtimes) add_dependencies(clang-bootstrap-deps runtimes)
Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/CMakeLists.txt Index: llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/CMakeLists.txt
=================================================================== ===================================================================
--- llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f.orig/openmp/CMakeLists.txt --- llvm-toolchain-snapshot_17~++20230126021740+85395af27241.orig/openmp/CMakeLists.txt
+++ llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/CMakeLists.txt +++ llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/CMakeLists.txt
@@ -83,6 +83,28 @@ else() @@ -91,6 +91,28 @@ else()
set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include") set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include")
endif() endif()
@ -55,10 +55,10 @@ Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/CMakeList
# Build host runtime library, after LIBOMPTARGET variables are set since they are needed # Build host runtime library, after LIBOMPTARGET variables are set since they are needed
# to enable time profiling support in the OpenMP runtime. # to enable time profiling support in the OpenMP runtime.
add_subdirectory(runtime) add_subdirectory(runtime)
Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/libomptarget/plugins/CMakeLists.txt Index: llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/libomptarget/plugins/CMakeLists.txt
=================================================================== ===================================================================
--- llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f.orig/openmp/libomptarget/plugins/CMakeLists.txt --- llvm-toolchain-snapshot_17~++20230126021740+85395af27241.orig/openmp/libomptarget/plugins/CMakeLists.txt
+++ llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/libomptarget/plugins/CMakeLists.txt +++ llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/libomptarget/plugins/CMakeLists.txt
@@ -48,6 +48,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tma @@ -48,6 +48,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tma
NO_INSTALL_RPATH NO_INSTALL_RPATH
) )
@ -68,24 +68,24 @@ Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/libomptar
# Install plugin under the lib destination folder. # Install plugin under the lib destination folder.
install(TARGETS "omptarget.rtl.${tmachine_libname}" install(TARGETS "omptarget.rtl.${tmachine_libname}"
LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}")
Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/libomptarget/plugins/cuda/CMakeLists.txt Index: llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/libomptarget/plugins/cuda/CMakeLists.txt
=================================================================== ===================================================================
--- llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f.orig/openmp/libomptarget/plugins/cuda/CMakeLists.txt --- llvm-toolchain-snapshot_17~++20230126021740+85395af27241.orig/openmp/libomptarget/plugins/cuda/CMakeLists.txt
+++ llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/libomptarget/plugins/cuda/CMakeLists.txt +++ llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/libomptarget/plugins/cuda/CMakeLists.txt
@@ -84,6 +84,8 @@ else() @@ -56,6 +56,8 @@ add_dependencies(omptarget.rtl.cuda ompt
endif() target_compile_definitions(omptarget.rtl.cuda PRIVATE TARGET_NAME="CUDA")
add_dependencies(omptarget.rtl.cuda omptarget.devicertl.nvptx) target_include_directories(omptarget.rtl.cuda PRIVATE ${LIBOMPTARGET_INCLUDE_DIR})
+add_runtimes_build_depends_if_needed(omptarget.rtl.cuda) +add_runtimes_build_depends_if_needed(omptarget.rtl.cuda)
+ +
# Install plugin under the lib destination folder. # Install plugin under the lib destination folder.
install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}")
set_target_properties(omptarget.rtl.cuda PROPERTIES set_target_properties(omptarget.rtl.cuda PROPERTIES
Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/libomptarget/src/CMakeLists.txt Index: llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/libomptarget/src/CMakeLists.txt
=================================================================== ===================================================================
--- llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f.orig/openmp/libomptarget/src/CMakeLists.txt --- llvm-toolchain-snapshot_17~++20230126021740+85395af27241.orig/openmp/libomptarget/src/CMakeLists.txt
+++ llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/libomptarget/src/CMakeLists.txt +++ llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/libomptarget/src/CMakeLists.txt
@@ -34,7 +34,9 @@ add_llvm_library(omptarget @@ -35,7 +35,9 @@ add_llvm_library(omptarget
PRIVATE PRIVATE
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports" "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports"
NO_INSTALL_RPATH NO_INSTALL_RPATH
@ -96,10 +96,10 @@ Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/libomptar
target_include_directories(omptarget PRIVATE ${LIBOMPTARGET_INCLUDE_DIR}) target_include_directories(omptarget PRIVATE ${LIBOMPTARGET_INCLUDE_DIR})
# libomptarget.so needs to be aware of where the plugins live as they # libomptarget.so needs to be aware of where the plugins live as they
Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/runtime/CMakeLists.txt Index: llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/runtime/CMakeLists.txt
=================================================================== ===================================================================
--- llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f.orig/openmp/runtime/CMakeLists.txt --- llvm-toolchain-snapshot_17~++20230126021740+85395af27241.orig/openmp/runtime/CMakeLists.txt
+++ llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/runtime/CMakeLists.txt +++ llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/runtime/CMakeLists.txt
@@ -292,6 +292,10 @@ if(LIBOMP_STATS) @@ -292,6 +292,10 @@ if(LIBOMP_STATS)
set(LIBOMP_USE_STDCPPLIB TRUE) set(LIBOMP_USE_STDCPPLIB TRUE)
endif() endif()
@ -111,11 +111,11 @@ Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/runtime/C
# Shared library can be switched to a static library # Shared library can be switched to a static library
set(LIBOMP_ENABLE_SHARED TRUE CACHE BOOL set(LIBOMP_ENABLE_SHARED TRUE CACHE BOOL
"Shared library instead of static library?") "Shared library instead of static library?")
Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/runtime/src/CMakeLists.txt Index: llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/runtime/src/CMakeLists.txt
=================================================================== ===================================================================
--- llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f.orig/openmp/runtime/src/CMakeLists.txt --- llvm-toolchain-snapshot_17~++20230126021740+85395af27241.orig/openmp/runtime/src/CMakeLists.txt
+++ llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/runtime/src/CMakeLists.txt +++ llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/runtime/src/CMakeLists.txt
@@ -135,6 +135,7 @@ endif() @@ -140,6 +140,7 @@ set_source_files_properties(${LIBOMP_GNU
if(NOT ${LIBOMP_USE_STDCPPLIB}) if(NOT ${LIBOMP_USE_STDCPPLIB})
set(LIBOMP_LINKER_LANGUAGE C) set(LIBOMP_LINKER_LANGUAGE C)
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES) set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES)
@ -123,7 +123,7 @@ Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/runtime/s
else() else()
set(LIBOMP_LINKER_LANGUAGE CXX) set(LIBOMP_LINKER_LANGUAGE CXX)
endif() endif()
@@ -196,6 +197,8 @@ else() @@ -201,6 +202,8 @@ else()
) )
endif() endif()
@ -132,10 +132,10 @@ Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/runtime/s
# Get the library's location within the build tree for the unit tester # Get the library's location within the build tree for the unit tester
if(NOT WIN32) if(NOT WIN32)
get_target_property(LIBOMP_LIBRARY_DIR omp LIBRARY_OUTPUT_DIRECTORY) get_target_property(LIBOMP_LIBRARY_DIR omp LIBRARY_OUTPUT_DIRECTORY)
Index: llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/tools/archer/CMakeLists.txt Index: llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/tools/archer/CMakeLists.txt
=================================================================== ===================================================================
--- llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f.orig/openmp/tools/archer/CMakeLists.txt --- llvm-toolchain-snapshot_17~++20230126021740+85395af27241.orig/openmp/tools/archer/CMakeLists.txt
+++ llvm-toolchain-snapshot_16~++20220920091612+a7d2409bac7f/openmp/tools/archer/CMakeLists.txt +++ llvm-toolchain-snapshot_17~++20230126021740+85395af27241/openmp/tools/archer/CMakeLists.txt
@@ -14,6 +14,9 @@ if(LIBOMP_OMPT_SUPPORT) @@ -14,6 +14,9 @@ if(LIBOMP_OMPT_SUPPORT)
add_library(archer SHARED ompt-tsan.cpp) add_library(archer SHARED ompt-tsan.cpp)
add_library(archer_static STATIC ompt-tsan.cpp) add_library(archer_static STATIC ompt-tsan.cpp)