This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Support loading of zippered dylibs
ClosedPublic

Authored by int3 on May 5 2021, 3:56 PM.

Details

Reviewers
oontvoo
Group Reviewers
Restricted Project
Commits
rG926076023526: [lld-macho] Support loading of zippered dylibs
Summary

ld64 can emit dylibs that support more than one platform (typically macOS and
macCatalyst). This diff allows LLD to read in those dylibs. Note that this is a
super bare-bones implementation -- in particular, I haven't added support for
LLD to emit those multi-platform dylibs, nor have I added a variety of
validation checks that ld64 does. Until we have a use-case for emitting zippered
dylibs, I think this is good enough.

Fixes PR49597.

Diff Detail

Event Timeline

int3 created this revision.May 5 2021, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2021, 3:56 PM
int3 requested review of this revision.May 5 2021, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2021, 3:56 PM
int3 edited the summary of this revision. (Show Details)May 5 2021, 3:56 PM
oontvoo added a subscriber: oontvoo.May 5 2021, 4:11 PM
oontvoo added inline comments.
lld/MachO/InputFiles.cpp
163

perhaps needs pulling and updating to removeSimulator(...) == ...?

(Sorry for the merge conflicts!)

int3 updated this revision to Diff 343232.May 5 2021, 4:21 PM
int3 marked an inline comment as done.

rebase

lld/MachO/InputFiles.cpp
163

no worries, I already had it in mind while reviewing your diff :)

oontvoo accepted this revision.May 5 2021, 8:05 PM
oontvoo added inline comments.
lld/MachO/InputFiles.h
229

It's a bit unfortunate that this function and the findCommand right above it are very similar ...
could the other one be refactored to return zero, one, or more somehow?

This revision is now accepted and ready to land.May 5 2021, 8:05 PM
This revision was landed with ongoing or failed builds.May 6 2021, 8:20 AM
This revision was automatically updated to reflect the committed changes.
int3 marked an inline comment as done.
int3 added inline comments.May 6 2021, 8:20 AM
lld/MachO/InputFiles.h
229

fair point... done :)