From 3fd76dbfe36f26da9c0f65d72ce11b56786c1d2a Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Sun, 10 Nov 2024 10:42:47 -0800 Subject: [PATCH] fix: Fix macOS arm64 crashes (#54) Enabling position independent code (PIC) resolves a crash in macOS arm64 builds. The idea to try this came from a relocation-related build failure on another machine, followed by me stubmling across a note that iOS requires PIC. Closes #51 --- build-scripts/90-ffmpeg.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-scripts/90-ffmpeg.sh b/build-scripts/90-ffmpeg.sh index c8aaf71..d483f46 100755 --- a/build-scripts/90-ffmpeg.sh +++ b/build-scripts/90-ffmpeg.sh @@ -57,6 +57,9 @@ elif [[ "$RUNNER_OS" == "macOS" ]]; then # else to resolve this, and from my searches, it appears that others are not # having this problem with ffmpeg. This is still a problem with n7.1 PLATFORM_CONFIGURE_FLAGS="$PLATFORM_CONFIGURE_FLAGS --disable-x86asm --disable-inline-asm" + + # Enable position independent code (PIC). This resolved a crash on arm64. + PLATFORM_CONFIGURE_FLAGS="$PLATFORM_CONFIGURE_FLAGS --enable-pic" elif [[ "$RUNNER_OS" == "Windows" ]]; then # /usr/local/incude and /usr/local/lib are not in mingw's include # and linker paths by default, so add them.