File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
compiler/rustc_target/src/spec/base/apple Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -158,12 +158,22 @@ pub(crate) fn base(
158158 SplitDebuginfo :: Off ,
159159 ] ) ,
160160
161+ // Tell the linker that we would like it to avoid irreproducible binaries.
162+ //
161163 // This environment variable is pretty magical but is intended for
162164 // producing deterministic builds. This was first discovered to be used
163165 // by the `ar` tool as a way to control whether or not mtime entries in
164- // the archive headers were set to zero or not. It appears that
165- // eventually the linker got updated to do the same thing and now reads
166- // this environment variable too in recent versions.
166+ // the archive headers were set to zero or not.
167+ //
168+ // In `ld64-351.8`, shipped with Xcode 9.3, the linker was updated to
169+ // read this flag too. Linker versions that don't support this flag
170+ // may embed modification timestamps in binaries (especially in debug
171+ // information).
172+ //
173+ // A cleaner alternative would be to pass the `-reproducible` flag,
174+ // though that is only supported since `ld64-819.6` shipped with Xcode
175+ // 14, which is too new for our minimum supported version:
176+ // https://doc.rust-lang.org/rustc/platform-support/apple-darwin.html#host-tooling
167177 //
168178 // For some more info see the commentary on #47086
169179 link_env : Cow :: Borrowed ( & [ ( Cow :: Borrowed ( "ZERO_AR_DATE" ) , Cow :: Borrowed ( "1" ) ) ] ) ,
You can’t perform that action at this time.
0 commit comments