This is an archive of the discontinued LLVM Phabricator instance.

[clang] [clang-offload-bundler] Fix finding installed llvm-objcopy
ClosedPublic

Authored by mgorny on Oct 13 2019, 1:07 PM.

Details

Summary

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.

Diff Detail

Event Timeline

mgorny created this revision.Oct 13 2019, 1:07 PM
abrachet accepted this revision.Oct 13 2019, 2:39 PM
This revision is now accepted and ready to land.Oct 13 2019, 2:39 PM
abrachet added inline comments.Oct 13 2019, 2:52 PM
clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
469

I'd be fine removing this FWIW. Is there a high chance they will be in the same directory? I think on a mac, there is very little chance this will be true because Apple preinstalls clang in /usr/bin, but not llvm-objcopy that would have to go in /usr/local/bin. Is it enough of an optimization to keep? Up to you I think.

sdmitriev accepted this revision.Oct 13 2019, 8:25 PM

Looks good.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2019, 10:38 PM