From 2f9e8c0570ffcab5da832fc3b6bbbdbc31c3d763 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sat, 5 Sep 2015 01:17:49 +0000 Subject: [PATCH] WinCOFFObjectWriter.cpp: Roll back TimeDateStamp along ENABLE_TIMESTAMPS. We want a deterministic output. GNU AS leaves it zero. FIXME: It may be optional by its user, like llc and clang. llvm-svn: 246905 --- llvm/lib/MC/WinCOFFObjectWriter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp index 9058edf33254..6c696738b48b 100644 --- a/llvm/lib/MC/WinCOFFObjectWriter.cpp +++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp @@ -1013,12 +1013,17 @@ void WinCOFFObjectWriter::writeObject(MCAssembler &Asm, Header.PointerToSymbolTable = offset; +#if (ENABLE_TIMESTAMPS == 1) // MS LINK expects to be able to use this timestamp to implement their // /INCREMENTAL feature. std::time_t Now = time(nullptr); if (Now < 0 || !isUInt<32>(Now)) Now = UINT32_MAX; Header.TimeDateStamp = Now; +#else + // We want a deterministic output. It looks like GNU as also writes 0 in here. + Header.TimeDateStamp = 0; +#endif // Write it all to disk... WriteFileHeader(Header);