From ede7c673892a0d25947dcbd12f32cc23adf9f9e1 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Mon, 16 Feb 2026 12:58:01 +0100 Subject: [PATCH] Fix build with -std= When building in strict mode (e.g. -std=c11), compilation of main/debug_gdb_scripts.c fails because asm() is not a standard top level statement. __asm__() however can be reserved by the compiler even in strict mode. Partially fixes GH-21215. IR needs a similar fix (dstogov/ir#128). Closes GH-21226. --- NEWS | 1 + main/debug_gdb_scripts.c | 2 +- scripts/gdb/debug_gdb_scripts_gen.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index b8c10e2be2f..4f965513037 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ PHP NEWS accessing properties on Reflection LazyProxy via isset()). (Arnaud) . Fixed OSS-Fuzz #478009707 (Borked assign-op/inc/dec on untyped hooked property backing value). (ilutov) + . Fixed bug GH-21215 (Build fails with -std=). (Arnaud) - Curl: . Fixed bug GH-21023 (CURLOPT_XFERINFOFUNCTION crash with a null callback). diff --git a/main/debug_gdb_scripts.c b/main/debug_gdb_scripts.c index 032dd09491b..43282857cf1 100644 --- a/main/debug_gdb_scripts.c +++ b/main/debug_gdb_scripts.c @@ -6,7 +6,7 @@ * * See https://sourceware.org/gdb/current/onlinedocs/gdb.html/dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section */ -asm( +__asm__( ".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n" ".byte 4 /* Python Text */\n" ".ascii \"gdb.inlined-script\\n\"\n" diff --git a/scripts/gdb/debug_gdb_scripts_gen.php b/scripts/gdb/debug_gdb_scripts_gen.php index 1b33d9a63aa..2667f249fe4 100755 --- a/scripts/gdb/debug_gdb_scripts_gen.php +++ b/scripts/gdb/debug_gdb_scripts_gen.php @@ -27,7 +27,7 @@ $ccode = sprintf( * * See https://sourceware.org/gdb/current/onlinedocs/gdb.html/dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section */ - asm( + __asm__( ".pushsection \".debug_gdb_scripts\", \"MS\",%%progbits,1\n" ".byte 4 /* Python Text */\n" ".ascii \"gdb.inlined-script\\n\"\n"