This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Don't pun -fuse-ld=lld as -fuse-ld=lld-link with msvc
AbandonedPublic

Authored by Ericson2314 on Nov 3 2019, 11:33 AM.

Details

Reviewers
rnk
mstorsjo
Summary

Besides the Mingw toolchain, there is also the CrossWindows toolchain,
which means GNU-style cli but genuine windows headers + libraries. LLD's
MinGW driver is as good a fit as binutil's ld, but there is no easy way
to select it when lld was being rewritten to lld-link.

This makes lld always be the GNU-style one, consistent with the non-msvc
case. It's a small breaking change for Windows, but the only
straightforward way.

It may seem silly to worry about the gnu-style flags, but it is useful
for mixing software designed with MinGW in mind with "real" windows
software that needs a MSVC C++ ABI, C++ threads, etc.

Testing in conjunction with https://github.com/NixOS/nixpkgs/pull/72366,
which might be the first fully automated way to cross compile to
Windows. I haven't taught Nixpkgs to wrap clang-cl like it wraps clang,
so even for some packages that have separate MSVC and MinGW builds
systems (e.g. zlib, opensll), I seem to be having better luck with the
MinGW-style builds so am going with that.

Backport of D69760 for release 8

Diff Detail

Event Timeline

Ericson2314 created this revision.Nov 3 2019, 11:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2019, 11:33 AM
Ericson2314 retitled this revision from [Clang][Driver] Don't pun -fuse-ld=lld as -fuse-ld=lld-link with msvc to [Driver] Don't pun -fuse-ld=lld as -fuse-ld=lld-link with msvc.Nov 3 2019, 2:42 PM

Same thing here, no need to send a separate patch for backporting.

(And in general, for cases where backporting would be relevant, you'd normally just make a patch for master, then let it be merged there, and request a backport of it from the release branch maintainer, who would do the cherrypicking - and only in conflicting cases, he'd request help merging. But all of that is done after the discussion of the initial patch for master has settled and the patch is merged in master.)

Ericson2314 abandoned this revision.Nov 8 2019, 2:08 PM

OK abandoning this too. Thanks for the extra info.