In internal google builds, MainExecPath doesn't go to the directory with clang.
Fall back to using Argv0 if MainExecPath doesn't find any clangs.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Sorry for the breakage, and thanks for making a patch!
This issue actually came up already a couple days ago, in https://github.com/llvm/llvm-project/issues/64927, and I considered doing something pretty much like this there as well - but the submitter managed to work around the issue quite neatly.
I’ve got mainly one suggestion; could you flip the nesting of the two loops? I’d like it to prefer <triple>-clang in parent(argv[0]) over clang in parent(MainExecPath).
As a side note, on windows, argv[0] is overwritten with the equivalent of MainExecPath by InitLLVM, but not on Unix.
Also, it’s nice to hear that llvm-rc actually is in use within Google - I’ve had a feeling that not many actually use this tool.
llvm/tools/llvm-rc/llvm-rc.cpp | ||
---|---|---|
139 | I see I had forgotten to update this comment here, as it is slightly wrong now - can you reword it s as part of this patch? |
I see I had forgotten to update this comment here, as it is slightly wrong now - can you reword it s as part of this patch?