This is an archive of the discontinued LLVM Phabricator instance.

[gn] Use "$link /lib" for archives instead of lib.exe
ClosedPublic

Authored by rnk on Apr 2 2019, 2:57 PM.

Details

Summary

This avoids the need to talk about lib.exe or llvm-lib.exe and it does
the right thing with LLD.

Diff Detail

Repository
rL LLVM

Event Timeline

rnk created this revision.Apr 2 2019, 2:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2019, 2:57 PM
thakis added a comment.Apr 2 2019, 3:47 PM

Does that do the right thing with link.exe? Should we only do this if use_lld?

rnk added a comment.Apr 2 2019, 3:58 PM

Does that do the right thing with link.exe? Should we only do this if use_lld?

Yep, it does the right thing. link -lib -? prints the options for lib.exe. I figured this was simpler than managing the path for a separate tool.

thakis accepted this revision.Apr 2 2019, 4:07 PM

TIL! It's not documented on https://docs.microsoft.com/en-us/cpp/build/reference/linker-options?view=vs-2019 but that now lld-link /lib makes much more sense to me :D

Thanks for the patch!

This revision is now accepted and ready to land.Apr 2 2019, 4:07 PM
This revision was automatically updated to reflect the committed changes.