Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check for using computed goto flag for re2c #11928

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ PHP NEWS
(Florian Engelhardt)
. Fixed bug GH-14650 (Compute the size of pages before allocating memory).
(Julien Voisin)
. Fixed bug GH-11928 (The --enable-re2c-cgoto doesn't add the -g flag).
(Peter Kokot)

- Curl:
. Deprecated the CURLOPT_BINARYTRANSFER constant. (divinity76)
Expand Down
31 changes: 15 additions & 16 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -170,31 +170,30 @@ PHP_PROG_RE2C([1.0.3], [--no-generation-date])
PHP_PROG_PHP()

PHP_ARG_ENABLE([re2c-cgoto],
[whether to enable computed goto gcc extension with re2c],
[whether to enable computed goto extension with re2c],
[AS_HELP_STRING([--enable-re2c-cgoto],
[Enable -g flag to re2c to use computed goto gcc extension])],
[Enable re2c -g flag to optimize conditional jumps using computed goto
extension, if supported by the compiler])],
[no],
[no])

AS_VAR_IF([PHP_RE2C_CGOTO], [no],, [
AC_MSG_CHECKING([whether re2c -g works])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
int main(int argc, const char **argv)
AS_VAR_IF([PHP_RE2C_CGOTO], [no],,
[AC_CACHE_CHECK([whether re2c -g works], [php_cv_have_re2c_cgoto],
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
int main(void)
{
argc = argc;
argv = argv;
label1:
;
label2:
static void *adr[] = { &&label1, &&label2};
;
static void *adr[] = { &&label1, &&label2 };
goto *adr[0];
return 0;
}
]])],[
AC_MSG_RESULT([no])
],[
AS_VAR_APPEND([RE2C_FLAGS], [" -g"])
AC_MSG_RESULT([yes])
])
}]])],
[php_cv_have_re2c_cgoto=yes],
[php_cv_have_re2c_cgoto=no])])
AS_VAR_IF([php_cv_have_re2c_cgoto], [yes],
[AS_VAR_APPEND([RE2C_FLAGS], [" -g"])])
])

dnl Platform-specific compile settings.
Expand Down
Loading