You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SLES15 compile error with mbstring oniguruma #20491
Compiling 8.4.14 fails with gcc 15.2.0
gcc-14 compiles 8.4.14, but has a warning.
/builds/php-8.4.14/ext/mbstring/php_mbregex.c: In function ‘php_mbregex_compile_pattern’:
/builds/php-8.4.14/ext/mbstring/php_mbregex.c:472:25: error: too many arguments to function ‘onig_error_code_to_str’; expected 0, have 3
472 | onig_error_code_to_str(err_str, err_code, &err_info);
| ^~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~
In file included from /builds/php-8.4.14/ext/mbstring/php_mbregex.c:31:
/usr/include/oniguruma.h:751:5: note: declared here
751 | int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
| ^~~~~~~~~~~~~~~~~~~~~~
/builds/php-8.4.14/ext/mbstring/php_mbregex.c: In function ‘_php_mb_regex_ereg_replace_exec’:
/builds/php-8.4.14/ext/mbstring/php_mbregex.c:1070:25: error: too many arguments to function ‘onig_error_code_to_str’; expected 0, have 2
1070 | onig_error_code_to_str(err_str, err);
| ^~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~
/usr/include/oniguruma.h:751:5: note: declared here
751 | int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
| ^~~~~~~~~~~~~~~~~~~~~~
/builds/php-8.4.14/ext/mbstring/php_mbregex.c: In function ‘zif_mb_split’:
/builds/php-8.4.14/ext/mbstring/php_mbregex.c:1242:17: error: too many arguments to function ‘onig_error_code_to_str’; expected 0, have 2
1242 | onig_error_code_to_str(err_str, err);
| ^~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~
/usr/include/oniguruma.h:751:5: note: declared here
751 | int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
| ^~~~~~~~~~~~~~~~~~~~~~
/builds/php-8.4.14/ext/mbstring/php_mbregex.c: In function ‘_php_mb_regex_ereg_search_exec’:
/builds/php-8.4.14/ext/mbstring/php_mbregex.c:1383:17: error: too many arguments to function ‘onig_error_code_to_str’; expected 0, have 2
1383 | onig_error_code_to_str(err_str, err);
| ^~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~
/usr/include/oniguruma.h:751:5: note: declared here
751 | int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
I used gcc 15.2 but from ubuntu 25.10 and the mbstring extension had no issue compiling, not even a warning. Wonder if there is an env var involved (e.g. CFLAGS). Would be helpful to have the build log (with compiler commands)
So that means that HAVE_STDARG_PROTOTYPES is unset. This can be set if we define HAVE_STDARG_H, which we can do because PHP requires at least C99 in which the header is always available.
I think the following patch would fix this but please confirm @VARGA-Peter :
diff --git a/ext/mbstring/php_onig_compat.h b/ext/mbstring/php_onig_compat.h
index c97ba0c5cb6..5a1fa8eeaaf 100644
--- a/ext/mbstring/php_onig_compat.h+++ b/ext/mbstring/php_onig_compat.h@@ -5,4 +5,10 @@
#define regex_t php_mb_regex_t
#define re_registers php_mb_re_registers
+/* Required for some distros that conditionally override PV_.+ * As we're in C99 this header is always available. */+#ifndef HAVE_STDARG_H+# define HAVE_STDARG_H+#endif+
#endif /* _PHP_ONIG_COMPAT_H */
Probably. You may risk that someone's going to remove that though because they may think "the header is always available, why do we need to check this?"
Activity
devnexen commentedon Nov 15, 2025
Hi @VARGA-Peter what are your ./configure commands and environment variables (e.g. CFLAGS) ? Cheers.
VARGA-Peter commentedon Nov 15, 2025
That's all. I use the default compiler settings.
devnexen commentedon Nov 15, 2025
I used gcc 15.2 but from ubuntu 25.10 and the mbstring extension had no issue compiling, not even a warning. Wonder if there is an env var involved (e.g. CFLAGS). Would be helpful to have the build log (with compiler commands)
ndossche commentedon Nov 15, 2025
The issue is specific to SLES15. Arguably this should be reported to them as it seems to me they meddled with the oniguruma source code.
The definition in oniguruma.h on that platform looks like this (same as upstream):
Where
PV_is defined as (differs):So that means that
HAVE_STDARG_PROTOTYPESis unset. This can be set if we defineHAVE_STDARG_H, which we can do because PHP requires at least C99 in which the header is always available.I think the following patch would fix this but please confirm @VARGA-Peter :
devnexen commentedon Nov 15, 2025
would updating configure.ac headers list work ?
ndossche commentedon Nov 15, 2025
Probably. You may risk that someone's going to remove that though because they may think "the header is always available, why do we need to check this?"
devnexen commentedon Nov 15, 2025
fair point
4 remaining items
[-]gcc-15 can't compile 8.4.14[/-][+]SLES15 compile error with mbstring oniguruma[/+]Fix phpGH-20491: SLES15 compile error with mbstring oniguruma
Merge branch 'PHP-8.3' into PHP-8.4
Merge branch 'PHP-8.4' into PHP-8.5
Merge branch 'PHP-8.5'
Fix GH-20491: SLES15 compile error with mbstring oniguruma