This is an archive of the discontinued LLVM Phabricator instance.

Give same-named members unique timestamps on Darwin in llvm-ar.
ClosedPublic

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

Details

Summary

This change ensures that the (membername,timestamp) tuple uniquely
identifies an entry in an archive for format=darwin, in deterministic
mode (which is the default).

That, then, enables lldb and dsymutil to locate the appropriate object
within the archive.

Event Timeline

jyknight created this revision.Jun 1 2018, 2:58 PM
JDevlieghere added inline comments.Jun 4 2018, 9:28 AM
llvm/lib/Object/ArchiveWriter.cpp
467

Spurious space in lldb path.

473

You could omit the braces as per the style guide.

501

I wonder if we should include the original timestamp in the calculation? I don't know if it's worth the extra work of keeping track of these artificial ones, as we'd need to ensure they don't crash with real timestamps.

jyknight marked 2 inline comments as done.Jun 16 2018, 2:51 PM
jyknight added inline comments.
llvm/lib/Object/ArchiveWriter.cpp
501

This code is only used in Deterministic mode, so there are no original timestamps to worry about.

JDevlieghere accepted this revision.Jun 19 2018, 3:04 AM

LGTM, Thanks!

This revision is now accepted and ready to land.Jun 19 2018, 3:04 AM

Just noticed I forgot to commit this. Will do so now. :)

This revision was automatically updated to reflect the committed changes.