[PATCH] D118965: [OpenMP] Add search path for llvm-strip
Kelvin Li via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 4 19:17:34 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8ea4aed50a9f: [OpenMP] Add search path for llvm-strip (authored by kkwli0).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118965/new/
https://reviews.llvm.org/D118965
Files:
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Index: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
===================================================================
--- clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -310,7 +310,13 @@
// 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");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118965.406144.patch
Type: text/x-patch
Size: 881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220205/71b4b038/attachment.bin>
More information about the cfe-commits
mailing list