Skip to content

Commit 073ae81

Browse files
keithcopybara-github
authored andcommitted
Add ZERO_AR_DATE to apple_env
This variable disables timestamps in archives and binary links in Apple's toolchain. Previously this was set for archives but not the links themselves. Relevant logic in ld64: https://github.com/keith/ld64/blob/86955a06a7e8e0d18ab28e521aa1122bfecd05a9/src/ld/Options.cpp#L4420-L4422 Fixes the other half of #10886 Closes #13091. PiperOrigin-RevId: 359724927
1 parent fa9aabe commit 073ae81

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tools/objc/libtool.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ fi
3434

3535
WRAPPER="${MY_LOCATION}/xcrunwrapper.sh"
3636

37-
# Ensure 0 timestamping for hermetic results.
38-
export ZERO_AR_DATE=1
39-
4037
if [ ! -f "${MY_LOCATION}"/libtool_check_unique ] ; then
4138
echo "libtool_check_unique not found. Please file an issue at github.com/bazelbuild/bazel"
4239
elif "${MY_LOCATION}"/libtool_check_unique "$@"; then

tools/osx/crosstool/cc_toolchain_config.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4559,6 +4559,10 @@ def _impl(ctx):
45594559
key = "APPLE_SDK_PLATFORM",
45604560
value = "%{apple_sdk_platform_value}",
45614561
),
4562+
env_entry(
4563+
key = "ZERO_AR_DATE",
4564+
value = "1",
4565+
),
45624566
] + [env_entry(key = key, value = value) for key, value in ctx.attr.extra_env.items()],
45634567
),
45644568
],

0 commit comments

Comments
 (0)