[clang] 2fb1316 - [OpenMP] Fix incorrect path taken when searching for LLD for offloading
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 26 07:51:30 PDT 2022
Author: Joseph Huber
Date: 2022-04-26T10:51:04-04:00
New Revision: 2fb131668fff921dcfedb0b22efb908cc794c07f
URL: https://github.com/llvm/llvm-project/commit/2fb131668fff921dcfedb0b22efb908cc794c07f
DIFF: https://github.com/llvm/llvm-project/commit/2fb131668fff921dcfedb0b22efb908cc794c07f.diff
LOG: [OpenMP] Fix incorrect path taken when searching for LLD for offloading
Summary:
A previous patch updated the path searching in the linker wrapper. I
made an error and caused `lld`, which is necessary to link AMDGPU
images, to not be found on some systems. This patch fixes this by
correctly searching that linker-wrapper's binary path first again.
Added:
Modified:
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Removed:
################################################################################
diff --git a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
index 2c14c893c6424..09381d93f17df 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -684,7 +684,8 @@ namespace amdgcn {
Expected<std::string> link(ArrayRef<std::string> InputFiles, Triple TheTriple,
StringRef Arch) {
// AMDGPU uses lld to link device object files.
- Expected<std::string> LLDPath = findProgram("lld", {CudaBinaryPath});
+ Expected<std::string> LLDPath =
+ findProgram("lld", {getMainExecutable("lld")});
if (!LLDPath)
return LLDPath.takeError();
More information about the cfe-commits
mailing list