[clang] [llvm] [OpenMP] Update the bitcode library install and search path (PR #136754)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 22 12:59:36 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-offload
Author: Joseph Huber (jhuber6)
<details>
<summary>Changes</summary>
Summary:
This was accidentally kept in the old location when we moved to the
new `lib/<triple>/` location for the DeviceRTL. Move this to reduce the
delta with https://github.com/llvm/llvm-project/pull/136729.
---
Full diff: https://github.com/llvm/llvm-project/pull/136754.diff
2 Files Affected:
- (modified) clang/lib/Driver/ToolChains/CommonArgs.cpp (+5)
- (modified) offload/DeviceRTL/CMakeLists.txt (+1-1)
``````````diff
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 8646c55060b17..7cc4008ec1f2b 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2794,6 +2794,11 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
for (const auto &LibPath : HostTC.getFilePaths())
LibraryPaths.emplace_back(LibPath);
+ // Check the target specific library path for the triple as well.
+ SmallString<128> P(D.Dir);
+ llvm::sys::path::append(P, "..", "lib", Triple.getTriple());
+ LibraryPaths.emplace_back(P);
+
OptSpecifier LibomptargetBCPathOpt =
Triple.isAMDGCN() ? options::OPT_libomptarget_amdgpu_bc_path_EQ
: Triple.isNVPTX() ? options::OPT_libomptarget_nvptx_bc_path_EQ
diff --git a/offload/DeviceRTL/CMakeLists.txt b/offload/DeviceRTL/CMakeLists.txt
index 12f53a30761f3..b1c48cbaefe16 100644
--- a/offload/DeviceRTL/CMakeLists.txt
+++ b/offload/DeviceRTL/CMakeLists.txt
@@ -137,7 +137,7 @@ function(compileDeviceRTLLibrary target_name target_triple)
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm" "-march=")
install(TARGETS libomptarget-${target_name}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
- DESTINATION ${OFFLOAD_INSTALL_LIBDIR})
+ DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${target_triple}")
add_library(omptarget.${target_name}.all_objs OBJECT IMPORTED)
set_property(TARGET omptarget.${target_name}.all_objs APPEND PROPERTY IMPORTED_OBJECTS
``````````
</details>
https://github.com/llvm/llvm-project/pull/136754
More information about the llvm-commits
mailing list