This is an archive of the discontinued LLVM Phabricator instance.

COFF: make builds more reproducible
ClosedPublic

Authored by compnerd on Sep 9 2016, 9:27 AM.

Details

Reviewers
ruiu
Summary

Change the way we calculate the build id to use MD5 to give reproducible build
ids. Previously we would generate random bytes for the build id GUID.

Diff Detail

Event Timeline

compnerd updated this revision to Diff 70851.Sep 9 2016, 9:27 AM
compnerd retitled this revision from to COFF: make builds more reproducible.
compnerd updated this object.
compnerd added a reviewer: ruiu.
compnerd set the repository for this revision to rL LLVM.
compnerd added a project: lld.
compnerd added a subscriber: llvm-commits.
ruiu added inline comments.Sep 9 2016, 10:25 AM
COFF/Writer.cpp
84–86

Please add a comment saying that we save DI to backfill DI->PDB70.Signature in Writer::writeBuildId.

89

It's a fresh file, so as long as you don't write anything, zeros are there, so this is a nop.

98
DI = nullptr;
805

Add a comment that why we have this (to fill CVSignature) and why we do this way (to get reproducible outputs.)

compnerd marked 4 inline comments as done.Sep 9 2016, 11:49 AM
compnerd added inline comments.
COFF/Writer.cpp
89

Zapped.

98

Oh, right, forgot about that. Nice! Changed to the initializer and zapped the constructor.

compnerd updated this revision to Diff 70878.Sep 9 2016, 11:50 AM
compnerd removed rL LLVM as the repository for this revision.
compnerd marked 2 inline comments as done.

Address comments.

ruiu accepted this revision.Sep 9 2016, 11:52 AM
ruiu edited edge metadata.

LGTM with a nit.

COFF/Writer.cpp
149

BuildId = nullptr, likewise.

This revision is now accepted and ready to land.Sep 9 2016, 11:52 AM
compnerd closed this revision.Sep 9 2016, 12:34 PM

SVN r281079 with the nit addressed.