PR #23333 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23333
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23333.patch

Win32 ABI only mandates 4 bytes stack alignment. GCC 16 changed default
align and no longer works with ffmpeg expectations.

Fixes crashes on aligned memory access in mingw32 gcc 16 build.

Fixes: https://fate.ffmpeg.org/report.cgi?time=20260604120705&slot=msys2-mingw32





From cba4661e01ecbdeac95e743abb86dcd5249abaa8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Thu, 4 Jun 2026 16:21:50 +0200
Subject: [PATCH] configure: set -mpreferred-stack-boundary=4 for Windows
 32-bit targets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Win32 ABI only mandates 4 bytes stack alignment. GCC 16 changed default
align and no longer works with ffmpeg expectations.

Fixes crashes on aligned memory access in mingw32 gcc 16 build.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 7cf06d404e..79390ea2ff 100755
--- a/configure
+++ b/configure
@@ -8172,8 +8172,8 @@ elif enabled gcc; then
     enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
     if enabled x86_32; then
         case $target_os in
-        *bsd*)
-            # BSDs don't guarantee a 16 byte aligned stack, but we can
+        *bsd*|mingw32|mingw64|win32|win64|cygwin*)
+            # These targets don't guarantee a 16 byte aligned stack, but we can
             # request GCC to try to maintain 16 byte alignment throughout
             # function calls. Library entry points that might call assembly
             # functions align the stack. (The parameter means 2^4 bytes.)
-- 
2.52.0

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

Reply via email to