aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/xcode
diff options
context:
space:
mode:
authorGravatar Chris Parsons <cparsons@google.com>2016-08-12 13:18:51 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-08-16 15:19:58 +0000
commit56e64460c586f5b69cffc99d1f52152a6a47cfbc (patch)
tree87688e1d4947d90d72f5029a489c5019625b4a1e /src/tools/xcode
parentf7a0818574e23d0a542a1f336761261dd1dbadd5 (diff)
Add export ZERO_AR_DATE=1 to libtool.sh to make the output hermetic, and touch the output of libtool to avoid hitting a bug in ld.
-- MOS_MIGRATED_REVID=130093791
Diffstat (limited to 'src/tools/xcode')
-rwxr-xr-xsrc/tools/xcode/libtool/libtool.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/tools/xcode/libtool/libtool.sh b/src/tools/xcode/libtool/libtool.sh
index 390a060def..722e9bb318 100755
--- a/src/tools/xcode/libtool/libtool.sh
+++ b/src/tools/xcode/libtool/libtool.sh
@@ -60,12 +60,20 @@ while [[ $# -gt 0 ]]; do
done < "${ARG}"
ARGS+=("${HASHED_FILELIST}")
;;
+ # Output flag
+ -o)
+ ARGS+=("${ARG}")
+ ARG="$1"
+ shift
+ ARGS+=("${ARG}")
+ OUTPUTFILE="${ARG}"
+ ;;
# Flags with no args
-static|-s|-a|-c|-L|-T|-no_warning_for_no_symbols)
ARGS+=("${ARG}")
;;
# Single-arg flags
- -o|-arch_only|-syslibroot)
+ -arch_only|-syslibroot)
ARGS+=("${ARG}")
ARG="$1"
shift
@@ -83,4 +91,11 @@ while [[ $# -gt 0 ]]; do
esac
done
+# Ensure 0 timestamping for hermetic results.
+export ZERO_AR_DATE=1
+
"${WRAPPER}" libtool "${ARGS[@]}"
+
+# Prevents a pre-Xcode-8 bug in which passing zero-date archive files to ld
+# would cause ld to error.
+touch "$OUTPUTFILE"