Index: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp =================================================================== --- clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp +++ clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp @@ -303,7 +303,13 @@ // We will use llvm-strip to remove the now unneeded section containing the // offloading code. - ErrorOr 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 StripPath = + sys::findProgramByName("llvm-strip", {COWDir}); if (!StripPath) return createStringError(StripPath.getError(), "Unable to find 'llvm-strip' in path");