[all-commits] [llvm/llvm-project] 65f637: [dsymutil] Skip duplicates files with identical ti...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Mon Jun 12 10:01:27 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 65f63739805e2c884364cb5b4b77430f96ecee7c
      https://github.com/llvm/llvm-project/commit/65f63739805e2c884364cb5b4b77430f96ecee7c
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-06-12 (Mon, 12 Jun 2023)

  Changed paths:
    A llvm/test/tools/dsymutil/ARM/static-archive-collision.test
    A llvm/test/tools/dsymutil/Inputs/private/tmp/collision/foo.a
    A llvm/test/tools/dsymutil/Inputs/private/tmp/collision/main.o
    A llvm/test/tools/dsymutil/Inputs/private/tmp/collision/main.out
    M llvm/tools/dsymutil/MachODebugMapParser.cpp

  Log Message:
  -----------
  [dsymutil] Skip duplicates files with identical time stamps in the debug map

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 print a single informative warning and skip
the ambiguous debug map objects.

rdar://110374836

Differential revision: https://reviews.llvm.org/D152585




More information about the All-commits mailing list