This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Force-loading should share code path with regular archive loads
ClosedPublic

Authored by int3 on Jan 22 2021, 1:44 PM.

Details

Summary

This extends D92539: [lld-macho] Support parsing of bitcode within archives to work even when we are loading archive
members via -force_load. I uncovered this issue while trying to
force-load archives containing bitcode -- we were segfaulting.

In addition to fixing the -force_load case, this diff also addresses
the behavior of -ObjC when LTO bitcode is involved -- we need to
force-load those archive members if they contain ObjC categories.

Diff Detail

Event Timeline

int3 created this revision.Jan 22 2021, 1:44 PM
int3 requested review of this revision.Jan 22 2021, 1:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 1:44 PM
int3 updated this revision to Diff 318642.Jan 22 2021, 1:45 PM

minor update

Harbormaster completed remote builds in B86353: Diff 318642.
int3 updated this revision to Diff 318647.Jan 22 2021, 2:07 PM

update test

Did I miss the test that would cover the deserialization of bitcode from a -force_load'ed archive?

int3 added inline comments.Jan 25 2021, 9:52 AM
lld/test/MachO/lto-archive.ll
14–15

Did I miss the test that would cover the deserialization of bitcode from a -force_load'ed archive?

It's here

smeenai accepted this revision.Feb 2 2021, 3:49 PM
smeenai added a subscriber: smeenai.

LGTM

This revision is now accepted and ready to land.Feb 2 2021, 3:49 PM
This revision was landed with ongoing or failed builds.Feb 3 2021, 10:44 AM
This revision was automatically updated to reflect the committed changes.