[Openmp-commits] [openmp] cef1199 - Revert "[openmp] No longer use LIBRARY_PATH to find devicertl"
Jon Chesterfield via Openmp-commits
openmp-commits at lists.llvm.org
Wed Sep 1 12:44:19 PDT 2021
Author: Jon Chesterfield
Date: 2021-09-01T20:44:12+01:00
New Revision: cef1199686475c0c63ba63ddb56f46bc7866fa3e
URL: https://github.com/llvm/llvm-project/commit/cef1199686475c0c63ba63ddb56f46bc7866fa3e
DIFF: https://github.com/llvm/llvm-project/commit/cef1199686475c0c63ba63ddb56f46bc7866fa3e.diff
LOG: Revert "[openmp] No longer use LIBRARY_PATH to find devicertl"
This reverts commit 7a228f872fbbefa6a6eba1d51da192761879fcca.
Failing test case under CI
Added:
Modified:
clang/lib/Driver/ToolChains/CommonArgs.cpp
openmp/libomptarget/test/lit.cfg
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index fb1aea20acc33..7c7f4d63eca0d 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1688,8 +1688,18 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
StringRef BitcodeSuffix,
const llvm::Triple &Triple) {
SmallVector<StringRef, 8> LibraryPaths;
-
- // Add path to clang lib / lib64 folder.
+ // Add user defined library paths from LIBRARY_PATH.
+ llvm::Optional<std::string> LibPath =
+ llvm::sys::Process::GetEnv("LIBRARY_PATH");
+ if (LibPath) {
+ SmallVector<StringRef, 8> Frags;
+ const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'};
+ llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr);
+ for (StringRef Path : Frags)
+ LibraryPaths.emplace_back(Path.trim());
+ }
+
+ // Add path to lib / lib64 folder.
SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir);
llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
LibraryPaths.emplace_back(DefaultLibPath.c_str());
diff --git a/openmp/libomptarget/test/lit.cfg b/openmp/libomptarget/test/lit.cfg
index b47e16c4be918..d4f63dd6c6de2 100644
--- a/openmp/libomptarget/test/lit.cfg
+++ b/openmp/libomptarget/test/lit.cfg
@@ -92,10 +92,6 @@ else: # Unices
append_dynamic_library_path('LIBRARY_PATH', config.library_dir, ":")
append_dynamic_library_path('LIBRARY_PATH', \
config.omp_host_rtl_directory, ":")
- if config.libomptarget_current_target.startswith('amdgcn'):
- config.test_flags += " --libomptarget-amdgcn-bc-path=" + config.library_dir
- if config.libomptarget_current_target.startswith('nvptx'):
- config.test_flags += " --libomptarget-nvptx-bc-path=" + config.library_dir
# substitutions
# - for targets that exist in the system create the actual command.
More information about the Openmp-commits
mailing list