This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] -weak_{library,framework} should always take priority
ClosedPublic

Authored by int3 on Dec 14 2020, 3:16 PM.

Details

Summary

We were not setting forceWeakImport for file paths given by
-weak_library if we had already loaded the file. This diff fixes that
by having loadDylib return a cached DylibFile instance even if we have
already loaded that file.

We still avoid emitting multiple LC_LOAD_DYLIBs, but we achieve this by
making inputFiles a SetVector instead of relying on the loadedDylibs
cache.

Diff Detail

Event Timeline

int3 requested review of this revision.Dec 14 2020, 3:16 PM
int3 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2020, 3:16 PM
smeenai accepted this revision.Dec 15 2020, 12:34 PM
smeenai added a subscriber: smeenai.

LGTM

This revision is now accepted and ready to land.Dec 15 2020, 12:34 PM
This revision was landed with ongoing or failed builds.Dec 15 2020, 1:00 PM
This revision was automatically updated to reflect the committed changes.