PR #23332 opened by Martin Storsjö (mstorsjo)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23332
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23332.patch

This is required for overriding defines that exist in the public
headers of checkasm, when e.g. building with assembly disabled
for an architecture where we normally would use the checked_call
wrapper.

This fixes a leftover in how checkasm is integrated into the
ffmpeg build system; there were many different approaches
considered for fixing --disable-asm, and the ffmpeg configure
integration didn't end up matching the final solution.

This fixes building with --disable-asm.




From 0ec9acee93ce8d6f3c3a12668bd72bb4d399adb6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <[email protected]>
Date: Thu, 4 Jun 2026 15:29:39 +0300
Subject: [PATCH 1/2] configure: Fix a mismatched include guard end comment

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 7cf06d404e..aaf53002b6 100755
--- a/configure
+++ b/configure
@@ -8899,7 +8899,7 @@ EOF
     fi
 
     cat >> $TMPH <<EOF
-#endif /* FFMPEG_CHECKASM_CONFIG_H */
+#endif /* FFMPEG_CHECKASM_CONFIG_GENERATED_H */
 EOF
 
     cp_if_changed $TMPH checkasm_config_generated.h
-- 
2.52.0


From 141ea3fa9a67ee1360188df1817e2f9579fc24b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <[email protected]>
Date: Thu, 4 Jun 2026 15:36:19 +0300
Subject: [PATCH 2/2] configure: Provide checkasm_header_config_generated.h as
 well

This is required for overriding defines that exist in the public
headers of checkasm, when e.g. building with assembly disabled
for an architecture where we normally would use the checked_call
wrapper.

This fixes a leftover in how checkasm is integrated into the
ffmpeg build system; there were many different approaches
considered for fixing --disable-asm, and the ffmpeg configure
integration didn't end up matching the final solution.

This fixes building with --disable-asm.
---
 configure               | 33 ++++++++++++++++++++++++---------
 tests/checkasm/Makefile | 12 ++++++++----
 2 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/configure b/configure
index aaf53002b6..31b1823298 100755
--- a/configure
+++ b/configure
@@ -8871,6 +8871,28 @@ if enabled checkasm; then
 EOF
 
     print_config HAVE_ "$TMPH" elf_aux_info getauxval ioctl isatty linux_perf 
pthread_np_h pthread_setaffinity_np sigaction siglongjmp clock_gettime prctl
+
+    if enabled aarch64; then
+        print_config HAVE_ "$TMPH" as_archext_sve_directive sve
+        print_config HAVE_ "$TMPH" as_archext_sme_directive sme
+    elif enabled riscv; then
+        print_config HAVE_ "$TMPH" sys_hwprobe_h asm_hwprobe_h
+    fi
+
+    cat >> $TMPH <<EOF
+#endif /* FFMPEG_CHECKASM_CONFIG_GENERATED_H */
+EOF
+
+    cp_if_changed $TMPH checkasm_config_generated.h
+
+    # Reopen a new TMPH for checkasm_config_generated.h
+    cat > $TMPH <<EOF
+/* Automatically generated by configure - do not modify! */
+#ifndef FFMPEG_CHECKASM_HEADER_CONFIG_GENERATED_H
+#define FFMPEG_CHECKASM_HEADER_CONFIG_GENERATED_H
+
+EOF
+
     print_config CHECKASM_ARCH_ "$TMPH" $ARCH_LIST
 
     # The callcheck harness requires x86asm/rv support on these platforms, so
@@ -8891,18 +8913,11 @@ EOF
 EOF
     fi
 
-    if enabled aarch64; then
-        print_config HAVE_ "$TMPH" as_archext_sve_directive sve
-        print_config HAVE_ "$TMPH" as_archext_sme_directive sme
-    elif enabled riscv; then
-        print_config HAVE_ "$TMPH" sys_hwprobe_h asm_hwprobe_h
-    fi
-
     cat >> $TMPH <<EOF
-#endif /* FFMPEG_CHECKASM_CONFIG_GENERATED_H */
+#endif /* FFMPEG_CHECKASM_HEADER_CONFIG_GENERATED_H */
 EOF
 
-    cp_if_changed $TMPH checkasm_config_generated.h
+    cp_if_changed $TMPH checkasm_header_config_generated.h
 
     if enabled x86asm; then
         append config_files $TMPASM
diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
index 3b1fc7b2ca..5a268089ee 100644
--- a/tests/checkasm/Makefile
+++ b/tests/checkasm/Makefile
@@ -147,11 +147,15 @@ $(CHECKASMOBJS): CFLAGS  := 
-I$(SRC_PATH)/tests/checkasm/ext/include $(CFLAGS)
 $(CHECKASMOBJS): ASFLAGS := -I$(SRC_PATH)/tests/checkasm/ext/include $(ASFLAGS)
 OUTDIRS += $(CHECKASMDIRS)
 
-# Expose checkasm_config_generated.h/asm to checkasm tests as well, as it
+# Expose checkasm_config_header_generated.h to checkasm tests as well, as it
 # modifies the behavior of include/checkasm/header_config.h
-$(CHECKASMOBJS): CFLAGS      += -DCHECKASM_HAVE_GENERATED_H
-$(CHECKASMOBJS): ASFLAGS     += -DCHECKASM_HAVE_GENERATED_H
-$(CHECKASMOBJS): X86ASMFLAGS += -DCHECKASM_HAVE_GENERATED_H
+$(CHECKASMOBJS): CFLAGS      += -DCHECKASM_HAVE_HEADER_GENERATED_H
+$(CHECKASMOBJS): ASFLAGS     += -DCHECKASM_HAVE_HEADER_GENERATED_H
+
+# Expose checkasm_config_generated.h/asm only to checkasm itself.
+$(EXT_CHECKASMOBJS): CFLAGS      += -DCHECKASM_HAVE_GENERATED_H
+$(EXT_CHECKASMOBJS): ASFLAGS     += -DCHECKASM_HAVE_GENERATED_H
+$(EXT_CHECKASMOBJS): X86ASMFLAGS += -DCHECKASM_HAVE_GENERATED_H
 
 tests/checkasm/checkasm.o: CFLAGS += -Umain
 
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to