[clang] [clang-scan-deps] Infer the tool locations from PATH (PR #108539)

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 08:20:35 PDT 2024


mstorsjo wrote:

And practically - in the cases I've seen where CMake generates calls to `clang-scan-deps`, it always invokes `clang-scan-deps ... -- /absolute/path/to/compiler` (CMake in general is very keen on absolute paths to tools).

But in separate testing of these tools, I ran into this situation, where `<triple>-clang ...` works and picks up the `<triple>.cfg` config file next to the `<triple>-clang` executable, and finds the colocated sysroot. But when invoking `clang-scan-deps -- <triple>-clang`, where `clang-scan-deps` itself is colocated with the `<triple>-clang` binary, it didn't find the config file nor the sysroot.

https://github.com/llvm/llvm-project/pull/108539


More information about the cfe-commits mailing list