summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2019-10-14 05:33:23 +0000
committerMichal Gorny <mgorny@gentoo.org>2019-10-14 05:33:23 +0000
commitf89e758d886a40aa44f13c4ab488c06fc8892654 (patch)
tree90337e37e89314956e381f1a444a88e025a3dca8 /clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
parenteecef1e5a5879bcd3ac001a932d0c001364e9063 (diff)
downloadbcm5719-llvm-f89e758d886a40aa44f13c4ab488c06fc8892654.tar.gz
bcm5719-llvm-f89e758d886a40aa44f13c4ab488c06fc8892654.zip
[clang] [clang-offload-bundler] Fix finding installed llvm-objcopy
Allow finding installed llvm-objcopy in PATH if it's not present in the directory containing clang-offload-bundler. This is the case if clang is being built stand-alone, and llvm-objcopy is already installed while the c-o-b tool is still present in build directory. This is consistent with how e.g. llvm-symbolizer is found in LLVM. However, most of similar searches in LLVM and Clang are performed without special-casing the program directory. Fixes r369955. Differential Revision: https://reviews.llvm.org/D68931 llvm-svn: 374754
Diffstat (limited to 'clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp')
-rw-r--r--clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
index 19325e4a33f..72def7756dd 100644
--- a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
+++ b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
@@ -468,6 +468,8 @@ public:
// Find llvm-objcopy in order to create the bundle binary.
ErrorOr<std::string> Objcopy = sys::findProgramByName(
"llvm-objcopy", sys::path::parent_path(BundlerExecutable));
+ if (!Objcopy)
+ Objcopy = sys::findProgramByName("llvm-objcopy");
if (!Objcopy) {
errs() << "error: unable to find 'llvm-objcopy' in path.\n";
return true;
OpenPOWER on IntegriCloud