[clang] [Driver] Ensure ToolChain::LibraryPaths is not empty for non-Darwin (PR #87866)

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 9 06:59:52 PDT 2024


mstorsjo wrote:

> This seems to have had an unexpected effect. In a build where I don't use the new path style, I used to get the old path style returned like this:
> 
> ```
> $ clang -target x86_64-w64-mingw32 -print-runtime-dir
> /home/martin/clang-nightly/lib/clang/19/lib/windows
> ```
> 
> However after this change, now I'm getting the new style path, even if it doesn't exist, and if the old one actually did exist:
> 
> ```
> $ clang -target x86_64-w64-mingw32 -print-runtime-dir
> /home/martin/clang-nignhtly/lib/clang/19/lib/x86_64-w64-windows-gnu
> ```
> 
> I'm ok with changing the default if the old path style doesn't exist - but if it does exist, we should still return that. (I haven't dig into it to see why this is, yet.)

The reason for this seems to lie here: https://github.com/llvm/llvm-project/blob/ccdebbae4d77d3efc236af92c22941de5d437e01/clang/lib/Driver/Driver.cpp#L2213-L2219

Previously, this picked the `TC.getCompilerRTPath()` case, while this now always ends up going with `TC.getRuntimePath()` as it's never empty.


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


More information about the cfe-commits mailing list