[llvm-branch-commits] [clang] 14c432b - [OpenMP] Add search path for llvm-strip
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Feb 28 15:20:36 PST 2022
Author: Kelvin Li
Date: 2022-02-28T15:16:01-08:00
New Revision: 14c432b6a17a9ff447f2adecff4850fb62907aee
URL: https://github.com/llvm/llvm-project/commit/14c432b6a17a9ff447f2adecff4850fb62907aee
DIFF: https://github.com/llvm/llvm-project/commit/14c432b6a17a9ff447f2adecff4850fb62907aee.diff
LOG: [OpenMP] Add search path for llvm-strip
Add the build directory to the search path for llvm-strip instead
of solely relying on the PATH environment variable setting.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D118965
(cherry picked from commit 8ea4aed50a9f84d9617219ccc936c005c5f31c24)
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 de0af187731d3..2f5ddb77b7b3f 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -310,7 +310,13 @@ extractFromBinary(const ObjectFile &Obj,
// We will use llvm-strip to remove the now unneeded section containing the
// offloading code.
- ErrorOr<std::string> StripPath = sys::findProgramByName("llvm-strip");
+ void *P = (void *)(intptr_t)&Help;
+ StringRef COWDir = "";
+ auto COWPath = sys::fs::getMainExecutable("llvm-strip", P);
+ if (!COWPath.empty())
+ COWDir = sys::path::parent_path(COWPath);
+ ErrorOr<std::string> StripPath =
+ sys::findProgramByName("llvm-strip", {COWDir});
if (!StripPath)
return createStringError(StripPath.getError(),
"Unable to find 'llvm-strip' in path");
More information about the llvm-branch-commits
mailing list