Merge branch 'tor-gitlab/mr/645' into maint-0.4.7

This commit is contained in:
David Goulet 2022-10-27 11:42:07 -04:00
commit f09b913e18
2 changed files with 16 additions and 0 deletions

6
changes/ticket40683 Normal file
View File

@ -0,0 +1,6 @@
o Minor feature (Mac and iOS build):
- Change 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. This fixes a build issue with recent Xcode versions on
Mac Silicon and iOS. Closes ticket 40683.

View File

@ -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"