This is an archive of the discontinued LLVM Phabricator instance.

Make timestamp writing in WinCOFFObjectWriter.cpp independent of ENABLE_TIMESTAMPS
ClosedPublic

Authored by thakis on Dec 26 2015, 9:52 AM.

Details

Reviewers
majnemer
chapuni
Summary

LLVM_ENABLE_TIMESTAMPS controls if timestamps are embedded into llvm's binaries. Turning it off is useful for deterministic builds.

r246905 made it so that the define suddenly also controls if the binaries that the llvm binaries _create_ embed timestamps or not – but this shouldn't be a configure-time option. r256203/r256204 added a driver option to toggle this on and off, so this patch now passes this driver option in LLVM_ENABLE_TIMESTAMPS builds so that if LLVM_ENABLE_TIMESTAMPS is set, the build of LLVM is deterministic – but the built clang can still write timestamps into other executables when requested.

This also allows removing some of the test machinery added in r292012 to work around this problem.

See PR24740 for background.

Diff Detail

Event Timeline

thakis updated this revision to Diff 43646.Dec 26 2015, 9:52 AM
thakis retitled this revision from to Make timestamp writing in WinCOFFObjectWriter.cpp independent of ENABLE_TIMESTAMPS.
thakis updated this object.
thakis added reviewers: majnemer, chapuni.
thakis added a subscriber: llvm-commits.

A new version of http://reviews.llvm.org/D15782 since I didn't add llvm-commits correctly there.

I didn't test the cmake goop yet, but it should be roughly correct.

thakis added inline comments.Jan 5 2016, 11:08 AM
cmake/modules/HandleLLVMOptions.cmake
371

Turns out this doesn't work since cl.exe only warns about unknown options (D9002) and it looks like there's no way to turn this into an error :-/

thakis updated this revision to Diff 44035.Jan 5 2016, 11:46 AM

Ok, please take a look. I checked that this does what I expect with cl.exe, clang-cl.exe that does understand /Brepro, clang-cl.exe that does understand /Brepro with an explicit -DCMAKE_EXE_LINKER_FLAGS=/incremental, and clang-cl.exe that does not yet understand /Brepro.

majnemer accepted this revision.Jan 6 2016, 10:26 AM
majnemer edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jan 6 2016, 10:26 AM
thakis closed this revision.Jan 6 2016, 11:09 AM

r256958, thanks!