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");
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");
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits