Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use old linker to fix illegal instruction segfault on macos arm64 #61

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions wheelbuild/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ echo "::group::Setup wheel installation"
echo "::endgroup::"

echo "::group::Test wheel"
if [ "$PLAT" == "arm64" ]; then
echo "Skipping test for Apple Silicon"
if [ "${PLAT}" == "arm64" ] && [ $(arch) != "arm64" ]; then
echo "Skipping tests for non-natively-built Apple Silicon wheel"
elif [[ "$MB_ML_LIBC" == "musllinux" ]] && [[ "$MB_PYTHON_VERSION" != "3.11" ]]&& [[ "$MB_PYTHON_VERSION" != "3.11" ]]; then
echo "Skipping tests for CI issue with musl python < 3.11"
else
Expand Down
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
Loading