[PATCH] D152585: [dsymutil] Skip duplicates files with identical time stamps in the debug map
Jonas Devlieghere via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 9 14:32:49 PDT 2023
JDevlieghere created this revision.
JDevlieghere added reviewers: friss, pete, aprantl, avl.
Herald added a project: All.
JDevlieghere requested review of this revision.
Herald added a project: LLVM.
Static archives can contain multiple files with the same file name, in which case the timestamp is used to disambiguate. Because timestamps are expressed in seconds since epoch timestamp collisions are far from impossible. Furthermore, to facilitate reproducible builds, the static linker can be told to emit no timestamps at all.
dsymutil already detects timestamp mismatches between the debug map and the object files. However, it does not handle timestamp collisions within the debug maps (STABS). Currently, we arbitrarily pick the first debug map entry and ignore the rest. This is incorrect: if a symbol exists in multiple object files, the linker might not have picked the one from the first object file. This also results in missing symbol warnings for all the symbols not defined in the first object file.
Given that in this scenario, dsymutil does not have enough information to disambiguate, it should instead print a single informative warning and skip the ambiguous debug map objects.
https://reviews.llvm.org/D152585
Files:
llvm/test/tools/dsymutil/ARM/static-archive-collision.test
llvm/test/tools/dsymutil/Inputs/private/tmp/collision/foo.a
llvm/test/tools/dsymutil/Inputs/private/tmp/collision/main.o
llvm/test/tools/dsymutil/Inputs/private/tmp/collision/main.out
llvm/tools/dsymutil/MachODebugMapParser.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152585.530080.patch
Type: text/x-patch
Size: 10019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230609/ee1e0ea6/attachment.bin>
More information about the llvm-commits
mailing list