This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Implement -force_load
ClosedPublic

Authored by int3 on Aug 7 2020, 12:54 PM.

Details

Reviewers
smeenai
Group Reviewers
Restricted Project
Commits
rG437e6bd286ac: [lld-macho] Implement -force_load
Summary

It's similar to lld-ELF's -whole-archive, but applied to individual
archives instead of to a series of them.

Diff Detail

Event Timeline

int3 created this revision.Aug 7 2020, 12:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2020, 12:54 PM
int3 requested review of this revision.Aug 7 2020, 12:54 PM
compnerd added inline comments.
lld/MachO/Driver.cpp
270

Can we do any better in terms of diagnostics here? Perhaps stringify the error?

275

This seems ... duplicative. The fatal is necessary, but Im not sure about printing out a subsequent message.

287

Id just cascade this:

if (Optional<MemoryBufferRef> archive = readFile(path))
  for (MemoryBufferRef member: getArchiveMembers(*archive))
    inputFiles.push_back(make<ObjFile>(member));
int3 updated this revision to Diff 284474.Aug 10 2020, 12:25 PM
int3 marked an inline comment as done.

cascade

lld/MachO/Driver.cpp
270

CHECK does stringify the error

275

this doesn't duplicate the CHECK on line 266 -- it's reporting any errors returned by the children() call

smeenai accepted this revision.Aug 12 2020, 5:27 PM
smeenai added a subscriber: smeenai.

LGTM

This revision is now accepted and ready to land.Aug 12 2020, 5:27 PM
This revision was automatically updated to reflect the committed changes.