This is an archive of the discontinued LLVM Phabricator instance.

[MachO] Properly reset global state
ClosedPublic

Authored by smeenai on Oct 30 2021, 4:55 PM.

Details

Reviewers
gkm
int3
Group Reviewers
Restricted Project
Commits
rG0f6d720f1f48: [MachO] Properly reset global state
Summary

We need to reset global state between runs, similar to the other ports.
There's some file-static state which needs to be reset as well and we
need to add some new helpers for that.

With this change, most LLD Mach-O tests pass with LLD_IN_TEST=2 (which
runs the linker twice on each test). Some tests will be fixed by the
remainder of this stack, and the rest are fundamentally incompatible
with that mode (e.g. they intentionally throw fatal errors).

Fixes PR52070.

Diff Detail

Event Timeline

smeenai created this revision.Oct 30 2021, 4:55 PM
Herald added a project: Restricted Project. · View Herald Transcript
smeenai requested review of this revision.Oct 30 2021, 4:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 30 2021, 4:55 PM
int3 accepted this revision.Oct 30 2021, 7:28 PM
int3 added a subscriber: int3.

lgtm

This revision is now accepted and ready to land.Oct 30 2021, 7:28 PM
This revision was automatically updated to reflect the committed changes.