mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-22 22:25:51 +01:00
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.
This commit is contained in:
parent
a1c40c8511
commit
256339712d
1 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,15 @@ abspath() {
|
||||||
echo "$(cd "$(dirname "$1")" >/dev/null && pwd)/$(basename "$1")"
|
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")
|
TARGET=$(abspath "$1")
|
||||||
|
|
||||||
shift
|
shift
|
||||||
|
@ -25,6 +34,7 @@ for input in "$@"; do
|
||||||
done
|
done
|
||||||
|
|
||||||
cd "$TMPDIR" >/dev/null
|
cd "$TMPDIR" >/dev/null
|
||||||
|
apple_symdef_fix
|
||||||
"${AR:-ar}" "${ARFLAGS:-cru}" library.tmp.a ./*/**
|
"${AR:-ar}" "${ARFLAGS:-cru}" library.tmp.a ./*/**
|
||||||
"${RANLIB:-ranlib}" library.tmp.a
|
"${RANLIB:-ranlib}" library.tmp.a
|
||||||
mv -f library.tmp.a "$TARGET"
|
mv -f library.tmp.a "$TARGET"
|
||||||
|
|
Loading…
Add table
Reference in a new issue