Skip to content

Commit

Permalink
Add ZERO_AR_DATE to apple_env
Browse files Browse the repository at this point in the history
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 bazelbuild#10886

Closes bazelbuild#13091.

PiperOrigin-RevId: 359724927
  • Loading branch information
keith authored and copybara-github committed Feb 26, 2021
1 parent fa9aabe commit 073ae81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tools/objc/libtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ fi

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

# Ensure 0 timestamping for hermetic results.
export ZERO_AR_DATE=1

if [ ! -f "${MY_LOCATION}"/libtool_check_unique ] ; then
echo "libtool_check_unique not found. Please file an issue at github.com/bazelbuild/bazel"
elif "${MY_LOCATION}"/libtool_check_unique "$@"; then
Expand Down
4 changes: 4 additions & 0 deletions tools/osx/crosstool/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4559,6 +4559,10 @@ def _impl(ctx):
key = "APPLE_SDK_PLATFORM",
value = "%{apple_sdk_platform_value}",
),
env_entry(
key = "ZERO_AR_DATE",
value = "1",
),
] + [env_entry(key = key, value = value) for key, value in ctx.attr.extra_env.items()],
),
],
Expand Down

0 comments on commit 073ae81

Please sign in to comment.