[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 23 08:48:51 PDT 2024


mstorsjo wrote:

> I now did build clang at [ccdebba](https://github.com/llvm/llvm-project/commit/ccdebbae4d77d3efc236af92c22941de5d437e01) and [ccdebba](https://github.com/llvm/llvm-project/commit/ccdebbae4d77d3efc236af92c22941de5d437e01)^. [ccdebba](https://github.com/llvm/llvm-project/commit/ccdebbae4d77d3efc236af92c22941de5d437e01) has `/DEFAULTLIB:clang_rt.profile.lib` in its output, [ccdebba](https://github.com/llvm/llvm-project/commit/ccdebbae4d77d3efc236af92c22941de5d437e01)^ has /DEFAULTLIB:clang_rt.profile-x86_64.lib`. So definitely due to this change.
> 
> It sounds like you're saying that's not intentional?

I didn't author this, but as far as I understood, the intent of this patch was only to make sure to print the new style path to ease disambiguation for the cases when both are missing - i.e. the same as #81037, for some cases that wasn't covered by the former.

I never saw this PR as one that had intended functional effects.

At this point, with more and more functional effects popping up, that aren't mentioned as intended within the commit message, I would suggest we revert this - and at least collect all the observed side effects and declare them before considering relanding it.



> Will the contents of `empty.asm` correct if `lib/<triple>/clang_rt.profile.lib` doesn't exist? I mean, will `empty.asm` contains `/DEFAULTLIB:clang_rt.profile-x86_64.lib` then?

This is in a case where this file does not exist, and neither does the new one. @nico wrote: 

> `foo` is a directly that contains just these two clang binaries

I.e. it is a directory that contains these two binaries and nothing else.

I do note that if `lib/clang/19/lib/windows/clang_rt.profile-x86_64.lib` does exist, i.e. if we add a `mkdir -p foo/lib/clang/19/lib/windows && touch foo/lib/clang/19/lib/windows/clang_rt.profile-x86_64.lib`, then we do still get the old name embedded.


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


More information about the cfe-commits mailing list