Skip to content

Commit

Permalink
don't mark link itself
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSpickett authored and asl committed Nov 27, 2024
1 parent d0f18a6 commit d7b8049
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ When targeting Windows, clang and clang-cl by default also embed the current tim

Both link.exe and lld-link also write the current timestamp into output .dll or .exe files. To make them instead write a hash of the binary into this field, you can pass `/Brepro` to the linker as well. However, some tools, such as Windows 7’s app compatibility database, try to interpret that field as an actual timestamp and can get confused if it’s set to a hash of the binary. For this case, lld-link also offers a <mark>/timestamp:</mark> flag that you can give an explicit timestamp that’s written into the output. You could use this to for example write the time of the commit the code is built at instead of the current time to make it deterministic. (But see the footnote on embedding commit hashes below.)

Visual Studio’s assemblers ml.exe and ml64.exe also insist on writing the current time into their output. In situations like this, where you can’t easily fix the tool to write the right output in the first place, you need to write wrappers that fix up the file after the fact. As an example, <mark>[ml.py](https://cs.chromium.org/chromium/src/build/toolchain/win/ml.py)</mark> is the wrapper the Chromium project uses to make ml’s output deterministic.
Visual Studio’s assemblers ml.exe and ml64.exe also insist on writing the current time into their output. In situations like this, where you can’t easily fix the tool to write the right output in the first place, you need to write wrappers that fix up the file after the fact. As an example, [ml.py](https://cs.chromium.org/chromium/src/build/toolchain/win/ml.py) <mark>is the wrapper the Chromium project uses to make ml’s output deterministic</mark>.

macOS’s libtool and ld64 also insist on writing timestamps into their outputs. You can set the environment variable <mark>ZERO_AR_DATE</mark> to 1 in a wrapper to make their output deterministic, but that confuses lldb of older Xcode versions.

Expand Down

0 comments on commit d7b8049

Please sign in to comment.