This is an archive of the discontinued LLVM Phabricator instance.

Fix support for distinguishing archive members by timestamp on Darwin.
ClosedPublic

Authored by jyknight on Jun 1 2018, 2:58 PM.

Details

Summary

On Darwin, the binary's symbol table points to debug info in object
files -- potentially object files within a static library. Such a
library may have multiple entries with the same name, distinguished
only by timestamp.

The code was already _attempting_ to handle this case (see the code in
ObjectContainerBSDArchive::Archive::FindObject which disambiguates via
timestamp). But, unfortunately, while the timestamp was taken into
account on the _first_ lookup, the result was then cached in a map
keyed only off of the path.

Added the timestamp to the cache, and added a test case.

Diff Detail

Repository
rL LLVM

Event Timeline

jyknight created this revision.Jun 1 2018, 2:58 PM
aprantl accepted this revision.Jun 1 2018, 3:17 PM

Very nice! Thanks.

lldb/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/Makefile
4 ↗(On Diff #149564)

dsymutil also implements the same mechanism, so as an end-to-end test it wouldn't hurt to also allow the dSYM variant of this test to be run.

Does MAKE_DSYM=NO disable the dsym category for this test or does it just prevent the dwarf variant from also producing a dSYM?

This revision is now accepted and ready to land.Jun 1 2018, 3:17 PM
aprantl added a subscriber: friss.
clayborg accepted this revision.Jun 1 2018, 4:02 PM
jyknight added inline comments.Jun 1 2018, 7:46 PM
lldb/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/Makefile
4 ↗(On Diff #149564)

Yeah, I'm not sure why that's there -- deleted.

I think I just copied it from another test's Makefile without thinking too hard. :)
AFAICT it doesn't even do anything -- the test infrastructure overrides MAKE_DSYM to NO or YES explicitly anyways, so this gets ignored. I suspect that it should be removed from all the other Makefiles too.

This revision was automatically updated to reflect the committed changes.