Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Jun Zhao via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Jun Zhao <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] configure: Fix ARM architecture feature detection for ARMv6 (PR #21256)
Date: Sun, 21 Dec 2025 23:39:19 -0000
Message-ID: <176636035968.60.13550997556676738699@2cb04c0e5124> (raw)

PR #21256 opened by Jun Zhao (mypopydev)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21256
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21256.patch

When configuring for ARMv6 targets (e.g., Raspberry Pi 1 with
ARM1176JZF-S), the configure script incorrectly enabled ARMv6T2
and NEON features that are not supported by plain ARMv6 cores.

All ARM architecture extensions are enabled by default, and the
subarch-based case statement only enabled optimization flags
without explicitly disabling incompatible features.

This fix adds explicit feature disabling based on the detected ARM
subarchitecture:
- ARMv5TE: Disable all ARMv6+ features
- ARMv6 variants: Disable ARMv6T2, NEON, and VFPv3
- ARMv6T2: Disable NEON and VFPv3
- ARMv7/8: Let compiler tests determine feature support

Without this fix, compiled binaries would contain unsupported
instructions and crash with SIGILL on ARMv6 devices.

Fixes trac ticket #11695

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>


>From 212753d3dc2c31456019345a1718e273f6677dd5 Mon Sep 17 00:00:00 2001
From: Jun Zhao <barryjzhao@tencent.com>
Date: Sun, 21 Dec 2025 20:28:26 +0800
Subject: [PATCH] configure: Fix ARM architecture feature detection for ARMv6

When configuring for ARMv6 targets (e.g., Raspberry Pi 1 with
ARM1176JZF-S), the configure script incorrectly enabled ARMv6T2
and NEON features that are not supported by plain ARMv6 cores.

All ARM architecture extensions are enabled by default, and the
subarch-based case statement only enabled optimization flags
without explicitly disabling incompatible features.

This fix adds explicit feature disabling based on the detected ARM
subarchitecture:
- ARMv5TE: Disable all ARMv6+ features
- ARMv6 variants: Disable ARMv6T2, NEON, and VFPv3
- ARMv6T2: Disable NEON and VFPv3
- ARMv7/8: Let compiler tests determine feature support

Without this fix, compiled binaries would contain unsupported
instructions and crash with SIGILL on ARMv6 devices.

Fixes trac ticket #11695

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 configure | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 4791a67562..0f07757f83 100755
--- a/configure
+++ b/configure
@@ -5570,10 +5570,33 @@ elif enabled arm; then
     esac
 
     case "$subarch" in
-        armv5t*)    enable fast_clz                ;;
-        armv[6-8]*)
+        armv5t*)
+            enable fast_clz
+            # ARMv5TE doesn't support ARMv6+ features
+            disable armv6 armv6t2 neon vfp vfpv3
+            ;;
+        armv6)
             enable fast_clz
             disabled fast_unaligned || enable fast_unaligned
+            # Plain ARMv6 doesn't support ARMv6T2 or NEON
+            disable armv6t2 neon vfpv3
+            ;;
+        armv6j|armv6k|armv6z|armv6zk)
+            enable fast_clz
+            disabled fast_unaligned || enable fast_unaligned
+            # These ARMv6 variants don't support ARMv6T2 or NEON
+            disable armv6t2 neon vfpv3
+            ;;
+        armv6t2*)
+            enable fast_clz
+            disabled fast_unaligned || enable fast_unaligned
+            # ARMv6T2 doesn't support NEON
+            disable neon vfpv3
+            ;;
+        armv[7-8]*)
+            enable fast_clz
+            disabled fast_unaligned || enable fast_unaligned
+            # ARMv7/ARMv8 features are checked later via compiler tests
             ;;
     esac
 
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-12-21 23:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176636035968.60.13550997556676738699@2cb04c0e5124 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git