Skip to content

Commit b5c364c

Browse files
fix arch armv4t being passed to linker when building boost.locale for iOS and tvOS
1 parent 19a1280 commit b5c364c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

boost.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ MACOS_SILICON_ARCHS=("arm64")
5959
IOS_ARCHS=("armv7" "arm64")
6060
IOS_SIM_ARCHS=("i386" "x86_64")
6161
MAC_CATALYST_ARCHS=("x86_64")
62+
TVOS_ARCH="arm64"
6263

6364
# Applied to all platforms
6465
CXX_FLAGS=""
@@ -793,6 +794,23 @@ EOF
793794

794795
bootstrapBoost()
795796
{
797+
PATCHED_FILE="$BOOST_SRC/tools/build/src/tools/darwin.jam"
798+
BACKUP_EXTENSION=bak
799+
mv -f "$PATCHED_FILE.$BACKUP_EXTENSION" "$PATCHED_FILE"
800+
# fixes boost passing `-arch arm` to linker which fails due to attempt to use armv4t
801+
PATCHED_FALLBACK_ARCH=
802+
if [[ "$1" == "iOS" ]]; then
803+
if grep -Fq armv <<<"${IOS_ARCHS[*]}"; then
804+
PATCHED_FALLBACK_ARCH=armv7
805+
else
806+
PATCHED_FALLBACK_ARCH=arm64
807+
fi
808+
elif [[ "$1" == "tvOS" ]]; then
809+
PATCHED_FALLBACK_ARCH=$TVOS_ARCH
810+
fi
811+
test "$PATCHED_FALLBACK_ARCH" && \
812+
sed -i ".$BACKUP_EXTENSION" -e "s/options = -arch arm ;/options = -arch $PATCHED_FALLBACK_ARCH ;/" "$PATCHED_FILE"
813+
796814
cd_or_abort "$BOOST_SRC"
797815
if [[ -z $BOOST_LIBS ]]; then
798816
./bootstrap.sh --without-libraries="${ALL_BOOST_LIBS// /,}"

0 commit comments

Comments
 (0)