]> git.lizzy.rs Git - rust.git/commit
Export ZERO_AR_DATE for macos linker invocations
authorAlex Crichton <alex@alexcrichton.com>
Tue, 5 May 2020 21:25:58 +0000 (14:25 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 26 May 2020 14:38:43 +0000 (07:38 -0700)
commitafd88f2a332df214d0c3a2cfbe9cc05482955a98
tree1a45cba5c67b34f4fe879e667adf993a9ed7bdbc
parentcb272d5d21c94f9a460d68d76817227a5913fbf7
Export ZERO_AR_DATE for macos linker invocations

This commit attempts to improve reproducibility of builds on macOS by
exporting the `ZERO_AR_DATE=1` environment variable for all invocations
of the linker. While it looks like this env var is targeted at just the
`ar` command (which does actually read this) it appears that recent-ish
versions of the linker *also* read this environment variable. This
env var forces the linker to set a deterministic zero value for the
mtime in the N_OSO field of the object file.

Currently it's believe that older versions of the linker will simply
ignore this env var, while newer versions will read it and produce a
deterministic output for compilations with debuginfo.

Closes #47086
Closes #66568
src/librustc_target/spec/apple_base.rs
src/test/run-make-fulldeps/reproducible-build-2/Makefile