This is an archive of the discontinued LLVM Phabricator instance.

vs integration: Use llvm-lib for librarian

Authored by russell.gallop on Apr 26 2019, 8:23 AM.



This uses llvm-lib.exe for the librarian instead of Visual Studio
provided lib.exe. Without this it is not possible to create static
libraries with -flto using the plugin.

Original patch by Steven Noonan

This fixes: PR41147

Diff Detail


Event Timeline

russell.gallop created this revision.Apr 26 2019, 8:23 AM
tycho accepted this revision.Apr 26 2019, 10:24 AM


Also this maybe an independent change, but:

One thing I ran into when running with this change locally was that llvm-lib.exe didn't like the /LTCG argument (IIRC it caused a fatal error and llvm-lib.exe refused to continue). This also affected lld-link.exe. I notice that LLVM.Cpp.Common.targets has a big list of options at the bottom that get automatically turned off for compatibility with the LLVM/clang-cl toolchain. Maybe we should add some for llvm-lib.exe and lld-link.exe to drop the /LTCG arguments? Or maybe remap /LTCG -> -flto=thin under the hood where relevant, or something.

This revision is now accepted and ready to land.Apr 26 2019, 10:24 AM
This revision was automatically updated to reflect the committed changes.
hans added a comment.Apr 30 2019, 5:49 AM

Thanks! I've rebuilt and published the extension: (version 1.0.359557).

I also updated the manifest to add VS 2019 support.