This is an archive of the discontinued LLVM Phabricator instance.

[LLD][MinGW] Add --[no-]guard-cf and --[no-]guard-longjmp
ClosedPublic

Authored by alvinhochun on Aug 28 2022, 10:13 AM.

Details

Summary

These will be LLD-specific options to support Control Flow Guard for the
MinGW target. They are disabled by default, but enabling --guard-cf
will also enable --guard-longjmp unless --no-guard-longjmp is also
specified. These options maps to -guard:cf,[no]longjmp.

Note that these features require the _load_config_used symbol to
contain the load config directory and be filled with the required
symbols. While current versions of mingw-w64 do not supply this symbol,
the user can provide their own version of it.

Diff Detail

Event Timeline

alvinhochun created this revision.Aug 28 2022, 10:13 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: mstorsjo. · View Herald Transcript

Update release notes

alvinhochun published this revision for review.Aug 28 2022, 10:39 AM
alvinhochun added a reviewer: mstorsjo.
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2022, 10:39 AM

This looks good to me, but I'd love if someone familiar with CFG (and/or GNU linker flag naming) would like to ack it too. I'll leave it unaccepted still, to maybe gather a bit more attention, but I'd be happy to approve it myself in a couple days time.

rnk accepted this revision.Aug 29 2022, 10:08 AM

lgtm

This revision is now accepted and ready to land.Aug 29 2022, 10:08 AM
mstorsjo added inline comments.Sep 8 2022, 4:15 AM
lld/MinGW/Driver.cpp
386

If I understand correctly, the flags passed on here are unambiguous wrt the lld-link interface (and wrt D132901), so we can land this one safely now (now that D132810 is approved too)?

alvinhochun added inline comments.Sep 8 2022, 5:17 AM
lld/MinGW/Driver.cpp
386

Yes, that's my understanding too.

MaskRay accepted this revision.Sep 8 2022, 8:50 PM
This revision was automatically updated to reflect the committed changes.