This is an archive of the discontinued LLVM Phabricator instance.

[LLD][MinGW] Support --allow-multiple-definition
Needs ReviewPublic

Authored by Ericson2314 on Nov 3 2019, 9:00 AM.

Details

Reviewers
mstorsjo
ruiu
rnk
Summary

We want the Clang CrossWindows toolchain to work with ld.lld and ld.bfd
alike, and it uses this, so we need to support this.

Event Timeline

Ericson2314 created this revision.Nov 3 2019, 9:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2019, 9:00 AM

Looks nice in general, but a couple minor details

lld/MinGW/Options.td
29

Nit: Stray empty line added here

lld/test/MinGW/driver.test
44

The newly added option in Options.td is for --allow-multiple-definition without a trailing s, but here you're testing with a trailing s. I presume it should be without s, as that's what ld.bfd supports, and that's what Clang's CrossWindows driver supports.

Two notes though: ld.bfd supports this option with both one and two leading dashes, and we try to match that as far as possible. (Previously lld was quite inconsistent wrt which options happened to handle both cases, but I tried cleaning it up some months ago.)

Secondly, ld.bfd doesn't seem to support the negative form. We can still add support for that (since it makes sense to have both forms), but do add a comment somewhere noting that only the nonnegated form matches ld.bfd.