commit:     303d30efa7ace15abbb9f65837683ac8e9897291
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  3 04:23:38 2026 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Feb  3 04:27:53 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=303d30ef

media-video/ffmpeg: explicitly pass --arch=arm for arm32

When not cross-compiling, `uname -m` is used to detect the arch
but this may be wrong for a arm64 kernel with arm32 userspace.
Normally mismatching kernel and userspace should rely on setarch
or linux32, but seems that there are users that use that without
a container/chroot.

This isn't needed for x86 given ffmpeg sees x86_64 and _32 as the
same thing (and we disable asm for bizarro x32), while for arm
it'll use the wrong asm.

Alternatively we could move --arch=$(tc-arch-kernel) out of the
cross condition -- albeit I'm not 100% sure that's always correct
given that's meant for the kernel and not ffmpeg, and it could be
adjusted based on kernel changes too. Ideally we should do our
own translation based on ARCH_LIST in ./configure, but I'd rather
not touch this further at this time.

Closes: https://bugs.gentoo.org/969514
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-video/ffmpeg/ffmpeg-4.4.5-r4.ebuild | 4 ++++
 media-video/ffmpeg/ffmpeg-4.4.6-r1.ebuild | 4 ++++
 media-video/ffmpeg/ffmpeg-6.1.4.ebuild    | 4 ++++
 media-video/ffmpeg/ffmpeg-7.1.3.ebuild    | 4 ++++
 media-video/ffmpeg/ffmpeg-8.0.1.ebuild    | 4 ++++
 media-video/ffmpeg/ffmpeg-9999.ebuild     | 4 ++++
 6 files changed, 24 insertions(+)

diff --git a/media-video/ffmpeg/ffmpeg-4.4.5-r4.ebuild 
b/media-video/ffmpeg/ffmpeg-4.4.5-r4.ebuild
index 017a422fce00..bc25246df5f3 100644
--- a/media-video/ffmpeg/ffmpeg-4.4.5-r4.ebuild
+++ b/media-video/ffmpeg/ffmpeg-4.4.5-r4.ebuild
@@ -445,6 +445,10 @@ multilib_src_configure() {
                        *mingw32*) conf+=( --target-os=mingw32 );;
                        *linux*) conf+=( --target-os=linux );;
                esac
+       elif use arm; then
+               # TODO?: could *always* pass tc-arch-kernel, albeit that 
function
+               # is meant for the kernel and just mostly matches by accident
+               conf+=( --arch=arm ) #969514
        fi
 
        # skipping tests is handled at configure-time

diff --git a/media-video/ffmpeg/ffmpeg-4.4.6-r1.ebuild 
b/media-video/ffmpeg/ffmpeg-4.4.6-r1.ebuild
index 9ce9c395d9d6..4efe67f1b645 100644
--- a/media-video/ffmpeg/ffmpeg-4.4.6-r1.ebuild
+++ b/media-video/ffmpeg/ffmpeg-4.4.6-r1.ebuild
@@ -445,6 +445,10 @@ multilib_src_configure() {
                        *mingw32*) conf+=( --target-os=mingw32 );;
                        *linux*) conf+=( --target-os=linux );;
                esac
+       elif use arm; then
+               # TODO?: could *always* pass tc-arch-kernel, albeit that 
function
+               # is meant for the kernel and just mostly matches by accident
+               conf+=( --arch=arm ) #969514
        fi
 
        # skipping tests is handled at configure-time

diff --git a/media-video/ffmpeg/ffmpeg-6.1.4.ebuild 
b/media-video/ffmpeg/ffmpeg-6.1.4.ebuild
index 8f76a9b2d41b..55be09cc0a73 100644
--- a/media-video/ffmpeg/ffmpeg-6.1.4.ebuild
+++ b/media-video/ffmpeg/ffmpeg-6.1.4.ebuild
@@ -502,6 +502,10 @@ multilib_src_configure() {
                        *mingw32*) conf+=( --target-os=mingw32 );;
                        *linux*) conf+=( --target-os=linux );;
                esac
+       elif use arm; then
+               # TODO?: could *always* pass tc-arch-kernel, albeit that 
function
+               # is meant for the kernel and just mostly matches by accident
+               conf+=( --arch=arm ) #969514
        fi
 
        # skipping tests is handled at configure-time

diff --git a/media-video/ffmpeg/ffmpeg-7.1.3.ebuild 
b/media-video/ffmpeg/ffmpeg-7.1.3.ebuild
index 086440f3aff5..5143701be89d 100644
--- a/media-video/ffmpeg/ffmpeg-7.1.3.ebuild
+++ b/media-video/ffmpeg/ffmpeg-7.1.3.ebuild
@@ -516,6 +516,10 @@ multilib_src_configure() {
                        *mingw32*) conf+=( --target-os=mingw32 );;
                        *linux*) conf+=( --target-os=linux );;
                esac
+       elif use arm; then
+               # TODO?: could *always* pass tc-arch-kernel, albeit that 
function
+               # is meant for the kernel and just mostly matches by accident
+               conf+=( --arch=arm ) #969514
        fi
 
        # skipping tests is handled at configure-time

diff --git a/media-video/ffmpeg/ffmpeg-8.0.1.ebuild 
b/media-video/ffmpeg/ffmpeg-8.0.1.ebuild
index b90647d85468..52022824dbea 100644
--- a/media-video/ffmpeg/ffmpeg-8.0.1.ebuild
+++ b/media-video/ffmpeg/ffmpeg-8.0.1.ebuild
@@ -514,6 +514,10 @@ multilib_src_configure() {
                        *mingw32*) conf+=( --target-os=mingw32 );;
                        *linux*) conf+=( --target-os=linux );;
                esac
+       elif use arm; then
+               # TODO?: could *always* pass tc-arch-kernel, albeit that 
function
+               # is meant for the kernel and just mostly matches by accident
+               conf+=( --arch=arm ) #969514
        fi
 
        # skipping tests is handled at configure-time

diff --git a/media-video/ffmpeg/ffmpeg-9999.ebuild 
b/media-video/ffmpeg/ffmpeg-9999.ebuild
index 9b8bbd3ff4cb..60bb2a095f5b 100644
--- a/media-video/ffmpeg/ffmpeg-9999.ebuild
+++ b/media-video/ffmpeg/ffmpeg-9999.ebuild
@@ -523,6 +523,10 @@ multilib_src_configure() {
                        *mingw32*) conf+=( --target-os=mingw32 );;
                        *linux*) conf+=( --target-os=linux );;
                esac
+       elif use arm; then
+               # TODO?: could *always* pass tc-arch-kernel, albeit that 
function
+               # is meant for the kernel and just mostly matches by accident
+               conf+=( --arch=arm ) #969514
        fi
 
        # skipping tests is handled at configure-time

Reply via email to