-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[OpenMP] Update the bitcode library install and search path #136754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 llvm#136729.
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-offload Author: Joseph Huber (jhuber6) ChangesSummary: Full diff: https://github.com/llvm/llvm-project/pull/136754.diff 2 Files Affected:
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common problem with compiler-rt and flang-rt: The installation target dir is lib${LLVM_LIBDIR_SUFFIX}
, but LLVM_LIBDIR_SUFFIX
is not used here. I guess some day somebody has to clean up the multilib support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another note: Paths should not be relative to P.Dir
. It should either be the resource dir or sysroot. Again, a common problem that I don't expect to be fixed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I mostly copied it from how clang gets the existing file paths. Probably should be cleaned up as a whole.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/18830 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/161/builds/5451 Here is the relevant piece of the build log for the reference
|
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 thedelta with #136729.