Skip to content

Commit

Permalink
fix: use old linker to fix illegal instruction segfault on macos arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Jul 16, 2024
1 parent 1d19ea2 commit c0f9f66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions wheelbuild/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit c0f9f66

Please sign in to comment.