diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -235,6 +235,8 @@ -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON + -DLIBOMPTARGET_NVPTX_CUDA_COMPILER=$ + -DLIBOMPTARGET_NVPTX_BC_LINKER=$ ${RUNTIMES_CMAKE_ARGS} PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES ${ARG_PREFIXES} @@ -335,6 +337,8 @@ -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON + -DLIBOMPTARGET_NVPTX_CUDA_COMPILER=$ + -DLIBOMPTARGET_NVPTX_BC_LINKER=$ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON -DLLVM_RUNTIMES_TARGET=${name} ${${name}_extra_args} diff --git a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt --- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt +++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt @@ -33,15 +33,6 @@ elseif (LLVM_TOOL_CLANG_BUILD AND NOT CMAKE_CROSSCOMPILING) # Compile the deviceRTL with the clang that is built in the project. set(cuda_compiler "$") -elseif(${CMAKE_C_COMPILER_ID} STREQUAL "Clang") - # Compile the device runtime with the compiler that OpenMP is built with. - # This is the case with LLVM_ENABLE_RUNTIMES=openmp. - # FIXME: This is unreliable; the compiler can be on older version of clang - # that does not support compiling CUDA, or only an older version of it. The - # risk is especially high on sytems where clang is the default compiler - # (MacOS, BSDs). LLVM_ENABLE_RUNTIMES=openmp should itself set - # LIBOMPTARGET_NVPTX_CUDA_COMPILER instead. - set(cuda_compiler ${CMAKE_C_COMPILER}) else() libomptarget_say("Not building NVPTX deviceRTL: clang not found") return()