summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2022-10-27 11:42:10 -0400
committerDavid Goulet <dgoulet@torproject.org>2022-10-27 11:42:10 -0400
commit2eb875b4a0714ad31258fbce7ae27e99c6687b12 (patch)
tree629e41a41eeb0af26618eeea4f1fa9815359392e
parent04f374357ac64a19a04cb90721a9f95db0e085ab (diff)
parentf09b913e18ef2a8d092b2c21840acc5f2d64c337 (diff)
downloadtor-2eb875b4a0714ad31258fbce7ae27e99c6687b12.tar.gz
tor-2eb875b4a0714ad31258fbce7ae27e99c6687b12.zip
Merge branch 'maint-0.4.7' into release-0.4.7
-rw-r--r--changes/ticket406836
-rwxr-xr-xscripts/build/combine_libs10
2 files changed, 16 insertions, 0 deletions
diff --git a/changes/ticket40683 b/changes/ticket40683
new file mode 100644
index 0000000000..6df078ebae
--- /dev/null
+++ b/changes/ticket40683
@@ -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.
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"