Repository navigation
debug_gdb_scripts.c:10:5: error: expected declaration specifiers or '...' before string constant 10 | ".pushsection ".debug_gdb_scripts", "MS",%progbits,1\n" #21215
Description
Description
export SYSTEMD_LIBS=/usr/lib/systemd
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libsdir/openssl/openssl-3.5.1/libcrypto.pc
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libsdir/libxml/libxml2-2.15.1
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libsdir/sqlite/sqlite-autoconf-3510100
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libsdir/zlib/zlib-1.3.1/lib
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libsdir/oniguruma/onig-6.9.10/src
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libsdir/icu/icu/source/i18n
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libsdir/icu/icu/source/common
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libsdir/icu/icu/source/io
export LIBXML_CFLAGS=-I$libsdir/libxml/libxml2-2.15.1/include
export LIBXML_LIBS=-L$libsdir/libxml/libxml2-2.15.1
export OPENSSL_CFLAGS=-I$libsdir/openssl/openssl-3.5.1/include
export OPENSSL_LIBS=-L$libsdir/openssl/openssl-3.5.1/lib
export PHP_SQLITE_CFLAGS=-I$libsdir/sqlite/sqlite-autoconf-3510100
export PHP_SQLITE_LIBS=-L$libsdir/sqlite/sqlite-autoconf-3510100
export ICU_CFLAGS="-I$libsdir/icu/icu/source/i18n -I$libsdir/icu/icu/source/common -I$libsdir/icu/icu/source/io"
export ICU_LIBS=-L$libsdir/icu/icu/source
export ONIG_CFLAGS=-I$libsdir/oniguruma/onig-6.9.10/src
export ONIG_LIBS=-L$libsdir/oniguruma/onig-6.9.10/src
export ZLIB_CFLAGS=-I$libsdir/zlib/zlib-1.3.1/include
export ZLIB_LIBS=-L$libsdir/zlib/zlib-1.3.1/lib export INTL_CFLAGS=-I$libsdir/gettext/gettext-0.26/include export INTL_LIBS=-L$libsdir/gettext/gettext-0.26/lib
export CURL_CFLAGS=-I$libsdir/curl/curl-8.17.0/include
export CURL_LIBS=-L$libsdir/curl/curl-8.17.0/lib
export SQLITE_LIBS=-L$libsdir/sqlite/sqlite-autoconf-3510100
export SQLITE_CFLAGS=-I$libsdir/sqlite/sqlite-autoconf-3510100
export NTP_LIBS=-L$libsdir/ntp/ntp-4.2.8p18/lib
export NTP_CFLAGS=-I$libsdir/ntp/ntp-4.2.8p18/include
export GNU_PTH=-L$libsdir/gnupth/pth-2.0.7
export LDFLAGS="-rdynamic -pthread -L/lib -L/usr/lib -I/usr/local/include $GNU_PTH $LIBXML_LIBS $OPENSSL_LIBS $ICU_LIBS $ONIG_LIBS $ZLIB_LIBS $INTL_LIBS $CURL_LIBS $SQLITE_LIBS $NTP_LIBS"
export LIBS="$LIBS $LDFLAGS"
export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/local/include:$PKG_CONFIG_PATH"
export PATH="$PATH:$LD_LIBRARY_PATH"
export ICU_CXXFLAGS="$ICU_CXXFLAGS -std=c++17"
export CXXFLAGS="$CXXFLAGS -std=c++17"
export CFLAGS="$CFLAGS -std=gnu99 -std=c99"
export CC=$(which gcc)
export LD=$(which ld)
./configure --enable-fpm=shared
--with-fpm-user=www-data
--with-fpm-group=www-data
--with-fpm-systemd \ --with-fpm-acl \ --with-fpm-selinux \ --with-fpm-apparmor \ --with-pdo-mysql=shared \ --with-mysql-sock="/var/mysqld/mysqld.pid"
--with-libxml=shared
--with-zlib
--enable-calendar
--enable-intl
--enable-mbstring
--enable-cli
--enable-soap
--disable-cgi \ --disable-phpdbg
--prefix="/usr/local/bin" \ --with-libdir=lib64
--with-libdir=$libsdir/sqlite/sqlite-autoconf-3510100 \ --with-libdir=$libsdir/libxml/libxml2-2.15.1/include
/bin/bash /var/www/html/libs/extr/php/php-8.5.2/libtool --silent --preserve-dup-deps --tag=CC --mode=compile /usr/bin/gcc -Imain/ -I/var/www/html/libs/extr/php/php-8.5.2/main/ -I/var/www/html/libs/extr/php/php-8.5.2/main -I/var/www/html/libs/extr/php/php-8.5.2 -I/var/www/html/libs/extr/php/php-8.5.2/ext/date/lib -I/var/www/html/libs/extr/libxml/libxml2-2.15.1/include -I/var/www/html/libs/extr/sqlite/sqlite-autoconf-3510100 -I/var/www/html/libs/extr/zlib/zlib-1.3.1/include -I/var/www/html/libs/extr/icu/icu/source/i18n -I/var/www/html/libs/extr/icu/icu/source/common -I/var/www/html/libs/extr/icu/icu/source/io -I/var/www/html/libs/extr/php/php-8.5.2/ext/lexbor -I/var/www/html/libs/extr/oniguruma/onig-6.9.10/src -I/var/www/html/libs/extr/php/php-8.5.2/ext/mbstring/libmbfl -I/var/www/html/libs/extr/php/php-8.5.2/ext/mbstring/libmbfl/mbfl -I/var/www/html/libs/extr/php/php-8.5.2/ext/uri/uriparser/include -I/var/www/html/libs/extr/php/php-8.5.2/TSRM -I/var/www/html/libs/extr/php/php-8.5.2/Zend -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -std=gnu99 -std=c99 -ffp-contract=off -fvisibility=hidden -DNDEBUG -Wimplicit-fallthrough=1 -DZEND_SIGNALS -c /var/www/html/libs/extr/php/php-8.5.2/main/debug_gdb_scripts.c -o main/debug_gdb_scripts.lo -MMD -MF main/debug_gdb_scripts.dep -MT main/debug_gdb_scripts.lo/var/www/html/libs/extr/php/php-8.5.2/main/debug_gdb_scripts.c:10:5: error: expected declaration specifiers or '...' before string constant 10 | ".pushsection ".debug_gdb_scripts", "MS",%progbits,1\n" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ make: *** [Makefile:2668: main/debug_gdb_scripts.lo] Error 1
PHP Version
8.5.2 from source
Operating System
Debian Forky
Activity
kayfairy commentedon Feb 14, 2026
php-8.5.2/Zend/zend_portability.h
#if defined(__cplusplus)# define ZEND_STATIC_ASSERT(c, m) _Static_assert((c), m)#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11># define ZEND_STATIC_ASSERT(c, m) _Static_assert((c), m)#else# define ZEND_STATIC_ASSERT(c, m)#endifSTDC_VERSION >= 201112L versioniong wrong. Use _Static_assert
Might help
[-]main/debug_gdb_scripts.c : error: expected declaration specifiers or '...' before string constant[/-][+]debug_gdb_scripts.c:10:5: error: expected declaration specifiers or '...' before string constant 10 | ".pushsection ".debug_gdb_scripts", "MS",%progbits,1\n"[/+]iluuu1994 commentedon Feb 15, 2026
Related to #14801, foreshadowed by @arnaud-lb the
%might not be portable.kayfairy commentedon Feb 15, 2026
Thank you for linking to the commit with the fix. Building on Cortex-A55.
Unfortunately commit dd777ec is already merged and didn't solve the error...
arnaud-lb commentedon Feb 16, 2026
This is due to
CFLAGSsetting-std=c99in your environment. This forces the compiler to not recognize the top levelasm()statement indebug_gdb_scripts.c.Building with
-std=gnu99appears to work, but please note that php-src requires a c11 compiler since 8.4: https://externals.io/message/124706#124706, so this is not recommended.Building with
-std=gnu11should work.Building with
-std=c11fails with the same error although it's expected to work. GH-21226 and dstogov/ir#128 should fix this.kayfairy commentedon Feb 16, 2026
Can you please pass all tested C, C++ and linker flags for building? It's nowhere documented.
Thank you for your help!
arnaud-lb commentedon Feb 16, 2026
You shouldn't need to set any compiler or linker flags explicitly: Building with
./configure --disable-debugwill just work.Fix build with -std=
arnaud-lb commentedon Feb 16, 2026
Reopening until dstogov/ir#128 is merged and pulled.