From dc45b12b7e7c14175bd8782c1b817b3e47cb3462 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 1 Nov 2025 13:46:12 -0500 Subject: [PATCH] Fix build of FFmpeg for armhf on aarch64 runners --- scripts/build-deps.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/build-deps.sh b/scripts/build-deps.sh index d3f3bd4..8e7aa1e 100755 --- a/scripts/build-deps.sh +++ b/scripts/build-deps.sh @@ -48,9 +48,18 @@ if [ "$USE_PLATFORM_FFMPEG" == "0" ]; then ninja -C build ninja install -C build + # FFmpeg's architecture detection uses 'uname -m' which will be incorrect when + # natively executing a different hardware-compatible ABI (like armhf on aarch64 + # or i686 on x86_64). We have to override that detection ourselves here. + FFMPEG_ARCH=$(dpkg --print-architecture) + if [ "$FFMPEG_ARCH" == "armhf" ]; then + # Most dpkg architectures are handled by FFmpeg, but armhf is a special case + FFMPEG_ARCH=arm + fi + # Build and install FFmpeg cd /opt/FFmpeg - ./configure $BASE_FFMPEG_ARGS $EXTRA_FFMPEG_ARGS $DAV1D_FFMPEG_ARGS + ./configure --arch=$FFMPEG_ARCH $BASE_FFMPEG_ARGS $EXTRA_FFMPEG_ARGS $DAV1D_FFMPEG_ARGS make -j$(nproc) make install fi