mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Wrap Zend stack limit check in AC_CACHE_CHECK (#14437)
The php_cv_have_stack_limit cache variable enables cross-compiling edge cases to override the check manually.
This commit is contained in:
parent
ca55603d8a
commit
75033c01c3
1 changed files with 9 additions and 11 deletions
20
Zend/Zend.m4
20
Zend/Zend.m4
|
@ -159,9 +159,8 @@ AC_CHECK_FUNCS([sigsetjmp],,
|
||||||
|
|
||||||
dnl Test whether the stack grows downwards
|
dnl Test whether the stack grows downwards
|
||||||
dnl Assumes contiguous stack
|
dnl Assumes contiguous stack
|
||||||
AC_MSG_CHECKING(whether the stack grows downwards)
|
AC_CACHE_CHECK([whether the stack grows downwards], [php_cv_have_stack_limit],
|
||||||
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([
|
||||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
int (*volatile f)(uintptr_t);
|
int (*volatile f)(uintptr_t);
|
||||||
|
@ -177,14 +176,13 @@ int main(void) {
|
||||||
f = stack_grows_downwards;
|
f = stack_grows_downwards;
|
||||||
return f((uintptr_t)&local) ? 0 : 1;
|
return f((uintptr_t)&local) ? 0 : 1;
|
||||||
}
|
}
|
||||||
]])], [
|
])],
|
||||||
AC_DEFINE([ZEND_CHECK_STACK_LIMIT], 1, [Define if checking the stack limit is supported])
|
[php_cv_have_stack_limit=yes],
|
||||||
AC_MSG_RESULT(yes)
|
[php_cv_have_stack_limit=no],
|
||||||
], [
|
[php_cv_have_stack_limit=no])])
|
||||||
AC_MSG_RESULT(no)
|
AS_VAR_IF([php_cv_have_stack_limit], [yes],
|
||||||
], [
|
[AC_DEFINE([ZEND_CHECK_STACK_LIMIT], [1],
|
||||||
AC_MSG_RESULT(no)
|
[Define to 1 if checking the stack limit is supported.])])
|
||||||
])
|
|
||||||
|
|
||||||
ZEND_CHECK_FLOAT_PRECISION
|
ZEND_CHECK_FLOAT_PRECISION
|
||||||
])
|
])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue