This is an archive of the discontinued LLVM Phabricator instance.

Vary Windows toolchain selection by -fuse-ld
ClosedPublic

Authored by kastiglione on Nov 1 2017, 2:10 PM.

Details

Summary

This change allows binutils to be used for linking with MSVC. Currently, when
using an MSVC target and -fuse-ld=bfd, the driver produces an invalid linker
invocation.

Diff Detail

Repository
rL LLVM

Event Timeline

kastiglione created this revision.Nov 1 2017, 2:10 PM
kastiglione retitled this revision from Vary toolchain selection by -fused-ld to Vary Windows toolchain selection by -fused-ld.Nov 1 2017, 2:10 PM

Use "link" as default when inspecting -fuse-ld=

smeenai added a subscriber: smeenai.Nov 1 2017, 2:47 PM
smeenai added inline comments.
lib/Driver/Driver.cpp
3884 ↗(On Diff #121185)

lld-link is a valid invocation for LLD as well, so I'd either add that option, change the equality option to a start check, or invert the check and check for an -fuse-ld= option starting with bfd (since we want the MSVC toolchain to be the default).

Also title says -fused-ld instead of -fuse-ld

kastiglione retitled this revision from Vary Windows toolchain selection by -fused-ld to Vary Windows toolchain selection by -fuse-ld.Nov 1 2017, 2:56 PM

Base decision on "bfd" prefix

kastiglione marked an inline comment as done.Nov 1 2017, 3:07 PM

Inline the arg variable

compnerd accepted this revision.Nov 6 2017, 12:54 PM
This revision is now accepted and ready to land.Nov 6 2017, 12:54 PM
This revision was automatically updated to reflect the committed changes.