diff options
| author | bors <bors@rust-lang.org> | 2020-05-26 17:38:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-05-26 17:38:47 +0000 |
| commit | 5239f5c57bb6eb9e894081727f5aba0a67e89763 (patch) | |
| tree | 47bb71e0e829facb54220895cbaf89ce67ddf0b1 /src/test | |
| parent | aeca4d6428c52cbf2c8d1f28657b0bdf92e4ea7c (diff) | |
| parent | afd88f2a332df214d0c3a2cfbe9cc05482955a98 (diff) | |
Auto merge of #71931 - alexcrichton:reproducible-macos, r=eddyb
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
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-make-fulldeps/reproducible-build-2/Makefile | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/test/run-make-fulldeps/reproducible-build-2/Makefile b/src/test/run-make-fulldeps/reproducible-build-2/Makefile index fc912efed5e..fd94516fbba 100644 --- a/src/test/run-make-fulldeps/reproducible-build-2/Makefile +++ b/src/test/run-make-fulldeps/reproducible-build-2/Makefile @@ -2,7 +2,6 @@ # ignore-musl # ignore-windows -# ignore-macos (rust-lang/rust#66568) # Objects are reproducible but their path is not. all: \ @@ -21,7 +20,7 @@ sysroot: rm -rf $(TMPDIR) && mkdir $(TMPDIR) $(RUSTC) reproducible-build-aux.rs $(RUSTC) reproducible-build.rs --crate-type rlib --sysroot $(shell $(RUSTC) --print sysroot) --remap-path-prefix=$(shell $(RUSTC) --print sysroot)=/sysroot - cp -r $(shell $(RUSTC) --print sysroot) $(TMPDIR)/sysroot + cp -R $(shell $(RUSTC) --print sysroot) $(TMPDIR)/sysroot cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib $(RUSTC) reproducible-build.rs --crate-type rlib --sysroot $(TMPDIR)/sysroot --remap-path-prefix=$(TMPDIR)/sysroot=/sysroot cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1 |
