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

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 08:07:51 PDT 2024


nico wrote:

Here's a minimal repro:

```
% cat empty.c
% foo/clang --driver-mode=cl empty.c --target=x86_64-pc-windows -fprofile-instr-generate -c /Fa && rg DEFAULTLIB empty.asm

23:	.ascii	" /DEFAULTLIB:libcmt.lib"
24:	.ascii	" /DEFAULTLIB:oldnames.lib"
25:	.ascii	" /DEFAULTLIB:clang_rt.profile.lib"

% foo/old-clang --driver-mode=cl empty.c --target=x86_64-pc-windows -fprofile-instr-generate -c /Fa && rg DEFAULTLIB empty.asm
23:	.ascii	" /DEFAULTLIB:libcmt.lib"
24:	.ascii	" /DEFAULTLIB:oldnames.lib"
25:	.ascii	" /DEFAULTLIB:clang_rt.profile-x86_64.lib"
```

`foo` is a directly that contains just these two clang binaries. `clang` is built at clang-llvmorg-19-init-8943-gd8503a38. `old-clang` is built at clang-llvmorg-19-init-8091-gab037c4f. ` git log llvmorg-19-init-8091-gab037c4f..llvmorg-19-init-8795-g39bfdb7f clang/lib/Driver/ToolChain.cpp` shows this as the only change in that range. (I admittedly haven't built clang at this rev and before yet to prove that it's due to this commit. I'll do that now, but it looks pretty plausible.)

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


More information about the cfe-commits mailing list