[PATCH] D101194: [Driver] Push multiarch path setup to individual drivers
Petr Hosek via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 24 18:02:03 PDT 2021
phosek added a comment.
In D101194#2714206 <https://reviews.llvm.org/D101194#2714206>, @MaskRay wrote:
>> Different platforms use different rules for multiarch triples so it's difficult to provide a single method for all platforms.
>
> Guess this is a Linux/Hurd/Fuchsia specific thing. I don't know much about the runtime build but I hope the Linux hierarchy is not set in stone.
>
> Can you dump a diff how `addPathIfExists(D, getStdlibPath(), Paths);` and a similar call will change `-L` paths in the linking stage?
> You can use `clang ... '-###' |& sed -E 's/ "?-L/\n&/g; s/ "?-[iI]/\n&/g'` to break -L into multiple lines.
There's no difference, current behavior is already covered by tests and those are still passing. The difference is that `ToolChain::getRuntimePath()` and `ToolChain::getStdlibPath()` currently try various possible spellings of triples whereas with this patch that's no longer needed because each platform controls its own spelling so we save a few syscalls.
I checked and the multiarch runtimes layout is currently only used by Fuchsia, Linux and WebAssembly, other platforms use their own custom logic. If other platforms decide to pickup this layout as well, they can follow the same pattern.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101194/new/
https://reviews.llvm.org/D101194
More information about the cfe-commits
mailing list