[PATCH] D51652: lld-link: Write an empty "repro" debug directory entry if /Brepro is passed

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 5 05:28:41 PDT 2018


thakis updated this revision to Diff 164018.
thakis marked an inline comment as done.
thakis added a comment.

In https://reviews.llvm.org/D51652#1224017, @pcc wrote:

> I wasn't imagining that we'd write 32 bits of hash to the repro directory but rather the 64-bit xxhash that we currently truncate to 32 bits to get it to fit into the timestamp field. Without that, isn't there a high probability of collisions after 65536 files (which could be small depending on the project)?


I don't know what tools use the timestamp for. The two main uses I know about are:

1. I think it's used for dll binding

2. It's part of the key under which executables get uploaded to symbol servers (the key is executable name, timestamp, size: https://cs.chromium.org/chromium/src/tools/clang/scripts/package.py?type=cs&q=img_fingerprint&sq=package:chromium&g=0&l=119).

Neither of these use the repro header as far as I can tell, and for compatibility reasons it's probably difficult to change them to make them use it. Having a bit of metadata that says "the timestamp isn't actually a time" makes sense, and that's what this patch does. I can see the argument for putting more bytes there, but I don't know of any practical advantages of doing it. Maybe I can put a FIXME about doing that?

(One thing that _is_ weird is that if you do `cl /Zi /Brepro foo.cc` (where link writes a 0-sized timestamp in the older VS version) link writes both the zero-sized repro entry but also sets the timestamp to the current time.)


https://reviews.llvm.org/D51652

Files:
  lld/COFF/Writer.cpp
  lld/test/COFF/rsds.test
  llvm/lib/Object/COFFObjectFile.cpp
  llvm/tools/llvm-readobj/COFFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51652.164018.patch
Type: text/x-patch
Size: 7861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180905/39bf0eb0/attachment-0001.bin>


More information about the llvm-commits mailing list