aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2022-10-14 12:12:46 +0200
committerAlexander Færøy <ahf@torproject.org>2022-10-14 12:12:46 +0200
commiteecd137c1b91584c53dce5d0c34451bc6e50d2bb (patch)
tree68c9423ff73712f56caf868ff2a4ede47e50849f /scripts
parent5080a4ff671da572afc0744d79402447ba57096f (diff)
downloadtor-eecd137c1b91584c53dce5d0c34451bc6e50d2bb.tar.gz
tor-eecd137c1b91584c53dce5d0c34451bc6e50d2bb.zip
Strip "__.SYMDEF*" before re-archiving in combine_libs on macOS and iOS.
This patch changes how combine_libs works on Darwin like platforms to make sure we don't include any `__.SYMDEF` and `__.SYMDEF SORTED` symbols on the archive before we repack and run ${RANLIB} on the archive. See: tpo/core/tor#40683.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/combine_libs10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/build/combine_libs b/scripts/build/combine_libs
index a855171dc7..9dec483602 100755
--- a/scripts/build/combine_libs
+++ b/scripts/build/combine_libs
@@ -11,6 +11,15 @@ abspath() {
echo "$(cd "$(dirname "$1")" >/dev/null && pwd)/$(basename "$1")"
}
+apple_symdef_fix() {
+ # On modern macOS and iOS we need to remove the "__.SYMDEF" and "__.SYMDEF
+ # SORTED" before we repack the archive.
+ # See: tor#40683.
+ if [ "$(uname -s)" = "Darwin" ] ; then
+ find . -name "__.SYMDEF*" -delete
+ fi
+}
+
TARGET=$(abspath "$1")
shift
@@ -25,6 +34,7 @@ for input in "$@"; do
done
cd "$TMPDIR" >/dev/null
+apple_symdef_fix
"${AR:-ar}" "${ARFLAGS:-cru}" library.tmp.a ./*/**
"${RANLIB:-ranlib}" library.tmp.a
mv -f library.tmp.a "$TARGET"