mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Autotools: Refactor PHP_BROKEN_GCC_STRLEN_OPT (#14824)
- Synced CS - Cache variable ac_cv_have_broken_gcc_strlen_opt renamed to php_cv_have_broken_gcc_strlen_opt
This commit is contained in:
parent
dccc911c04
commit
ae420538d2
2 changed files with 11 additions and 16 deletions
23
build/php.m4
23
build/php.m4
|
@ -1284,9 +1284,10 @@ dnl
|
||||||
dnl Early releases of GCC 8 shipped with a strlen() optimization bug, so they
|
dnl Early releases of GCC 8 shipped with a strlen() optimization bug, so they
|
||||||
dnl didn't properly handle the `char val[1]` struct hack. See bug #76510.
|
dnl didn't properly handle the `char val[1]` struct hack. See bug #76510.
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN([PHP_BROKEN_GCC_STRLEN_OPT], [
|
AC_DEFUN([PHP_BROKEN_GCC_STRLEN_OPT],
|
||||||
AC_CACHE_CHECK([for broken gcc optimize-strlen],ac_cv_have_broken_gcc_strlen_opt,[
|
[AC_CACHE_CHECK([for broken gcc optimize-strlen],
|
||||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
[php_cv_have_broken_gcc_strlen_opt],
|
||||||
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -1302,16 +1303,12 @@ int main(void)
|
||||||
strcpy(s->c, "foo");
|
strcpy(s->c, "foo");
|
||||||
return strlen(s->c+1) == 2;
|
return strlen(s->c+1) == 2;
|
||||||
}
|
}
|
||||||
]])],[
|
]])],
|
||||||
ac_cv_have_broken_gcc_strlen_opt=yes
|
[php_cv_have_broken_gcc_strlen_opt=yes],
|
||||||
],[
|
[php_cv_have_broken_gcc_strlen_opt=no],
|
||||||
ac_cv_have_broken_gcc_strlen_opt=no
|
[php_cv_have_broken_gcc_strlen_opt=no])])
|
||||||
],[
|
AS_VAR_IF([php_cv_have_broken_gcc_strlen_opt], [yes],
|
||||||
ac_cv_have_broken_gcc_strlen_opt=no
|
[AS_VAR_APPEND([CFLAGS], [" -fno-optimize-strlen"])])
|
||||||
])])
|
|
||||||
if test "$ac_cv_have_broken_gcc_strlen_opt" = "yes"; then
|
|
||||||
CFLAGS="$CFLAGS -fno-optimize-strlen"
|
|
||||||
fi
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
|
|
|
@ -445,9 +445,7 @@ AC_CHECK_HEADERS(m4_normalize([
|
||||||
|
|
||||||
PHP_FOPENCOOKIE
|
PHP_FOPENCOOKIE
|
||||||
PHP_BROKEN_GETCWD
|
PHP_BROKEN_GETCWD
|
||||||
if test "$GCC" = "yes"; then
|
AS_VAR_IF([GCC], [yes], [PHP_BROKEN_GCC_STRLEN_OPT])
|
||||||
PHP_BROKEN_GCC_STRLEN_OPT
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Detect the headers required to use makedev, major, and minor.
|
dnl Detect the headers required to use makedev, major, and minor.
|
||||||
dnl Autoconf <= 2.69 didn't check glibc 2.25 deprecated macros in sys/types.h.
|
dnl Autoconf <= 2.69 didn't check glibc 2.25 deprecated macros in sys/types.h.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue