From c0f9f663caa2677bb1e06f594715f681bca6d661 Mon Sep 17 00:00:00 2001 From: Frankie Dintino Date: Tue, 16 Jul 2024 12:06:04 -0400 Subject: [PATCH] fix: use old linker to fix illegal instruction segfault on macos arm64 --- wheelbuild/config.sh | 11 +++++++++-- winbuild/build_prepare.py | 8 ++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/wheelbuild/config.sh b/wheelbuild/config.sh index e158aeb..b54b4fe 100644 --- a/wheelbuild/config.sh +++ b/wheelbuild/config.sh @@ -4,7 +4,7 @@ set -eo pipefail CONFIG_DIR=$(abspath $(dirname "${BASH_SOURCE[0]}")) ARCHIVE_SDIR=pillow-avif-plugin-depends -LIBAVIF_VERSION=02fc53e73d68dccacc54ce543b1be1e9b3236495 +LIBAVIF_VERSION=1a1c778f8e0b7ecdf3af9e59a6f33eb4d7d3900e RAV1E_VERSION=0.7.1 CCACHE_VERSION=4.7.1 SCCACHE_VERSION=0.3.0 @@ -23,6 +23,13 @@ if [ -n "$IS_MACOS" ] && [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then LDFLAGS="${LDFLAGS} -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" fi +# Temporarily use old linker on macOS arm64. This fixes a bizarre bug where +# an invalid instruction is being inserted into the middle of the libaom +# function compute_stats_win5_neon +if [ -n "$IS_MACOS" ] && [ "$PLAT" == "arm64" ]; then + export LDFLAGS="${LDFLAGS} -ld64" +fi + call_and_restore_trace() { local rc local force_trace @@ -270,7 +277,7 @@ EOF group_start "Download libavif source" fetch_unpack \ - "https://github.com/fdintino/libavif/archive/$LIBAVIF_VERSION.tar.gz" \ + "https://github.com/AOMediaCodec/libavif/archive/$LIBAVIF_VERSION.tar.gz" \ "libavif-$LIBAVIF_VERSION.tar.gz" group_end diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index b3ac6c3..45c958d 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -180,11 +180,11 @@ def cmd_msbuild( }, "libavif": { "url": ( - "https://github.com/fdintino/libavif/archive/" - "02fc53e73d68dccacc54ce543b1be1e9b3236495.zip" + "https://github.com/AOMediaCodec/libavif/archive/" + "1a1c778f8e0b7ecdf3af9e59a6f33eb4d7d3900e.zip" ), - "filename": "libavif-02fc53e73d68dccacc54ce543b1be1e9b3236495.zip", - "dir": "libavif-02fc53e73d68dccacc54ce543b1be1e9b3236495", + "filename": "libavif-1a1c778f8e0b7ecdf3af9e59a6f33eb4d7d3900e.zip", + "dir": "libavif-1a1c778f8e0b7ecdf3af9e59a6f33eb4d7d3900e", "license": "LICENSE", "build": [ cmd_mkdir("build.pillow"),