[Openmp-commits] [clang] [openmp] [OFFLOAD] Build DeviceRTL with SPIRV backend (PR #174675)
Nick Sarnie via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jan 21 08:57:55 PST 2026
================
@@ -74,8 +78,15 @@ target_include_directories(libompdevice PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../../libc
${CMAKE_CURRENT_SOURCE_DIR}/../../offload/include)
target_compile_options(libompdevice PRIVATE ${compile_options})
-target_link_options(libompdevice PRIVATE
- "-flto" "-r" "-nostdlib" "-Wl,--lto-emit-llvm")
+if(NOT "${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^spirv" AND
+ NOT "${CMAKE_CXX_COMPILER_TARGET}" MATCHES "^spirv")
+ target_link_options(libompdevice PRIVATE
+ "-flto" "-r" "-nostdlib" "-Wl,--lto-emit-llvm")
+else()
+ target_link_options(libompdevice PRIVATE
+ "-nostdlib" "-emit-llvm")
+endif()
----------------
sarnex wrote:
The problem is currently SPIR-V uses an out of tree linker `spirv-link`, and nobody hooked up the driver to call `lld` instead of `spirv-link` if LTO is enabled. I will try to tackle that after I finish the couple of tasks I have now, but yeah right now LTO isn't hooked up.
https://github.com/llvm/llvm-project/pull/174675
More information about the Openmp-commits
mailing list