This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [COFF] Add a private option for setting the os version separately from subsystem version
ClosedPublic

Authored by mstorsjo on Oct 4 2020, 1:00 PM.

Details

Summary

The MinGW driver has separate options for OS and subsystem version. Having this available in lld-link allows the MinGW driver to both match GNU ld better and simplifies the code for merging two (potentially mismatching) arguments into one.

Diff Detail

Event Timeline

mstorsjo created this revision.Oct 4 2020, 1:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2020, 1:00 PM
Herald added a subscriber: dang. · View Herald Transcript
mstorsjo requested review of this revision.Oct 4 2020, 1:00 PM
rnk accepted this revision.Oct 5 2020, 11:12 AM

lgtm

lld/COFF/Driver.cpp
411–412

Setting /subsystem from .drectve is interesting. I guess we added in D39972 (2017). The subsystem can set the entry point, I believe, which can then influence which objects are loaded.

I guess this change doesn't add any new complexity.

This revision is now accepted and ready to land.Oct 5 2020, 11:12 AM