mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Do not remove -O0 in the middle of a flag Fix removal of optimization cflags in debug builds (#9647)
This commit is contained in:
12
build/php.m4
12
build/php.m4
@@ -2849,3 +2849,15 @@ AC_DEFUN([PHP_CHECK_AVX512_VBMI_SUPPORTS], [
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_AVX512_VBMI_SUPPORTS],
|
||||
[$have_avx512_vbmi_supports], [Whether the compiler supports AVX512 VBMI])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_REMOVE_OPTIMIZATION_FLAGS
|
||||
dnl
|
||||
dnl Removes known compiler optimization flags like -O, -O0, -O1, ..., -Ofast
|
||||
dnl from CFLAGS and CXXFLAGS.
|
||||
dnl
|
||||
AC_DEFUN([PHP_REMOVE_OPTIMIZATION_FLAGS], [
|
||||
sed_script='s/\([[\t ]]\|^\)-O\([[0-9gsz]]\|fast\|\)\([[\t ]]\|$\)/\1/g'
|
||||
CFLAGS=$(echo "$CFLAGS" | $SED -e "$sed_script")
|
||||
CXXFLAGS=$(echo "$CXXFLAGS" | $SED -e "$sed_script")
|
||||
])
|
||||
|
||||
10
configure.ac
10
configure.ac
@@ -860,10 +860,7 @@ if test "$PHP_GCOV" = "yes"; then
|
||||
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/build/Makefile.gcov, $abs_srcdir)
|
||||
|
||||
dnl Remove all optimization flags from CFLAGS.
|
||||
changequote({,})
|
||||
CFLAGS=`echo "$CFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
|
||||
CXXFLAGS=`echo "$CXXFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
|
||||
changequote([,])
|
||||
PHP_REMOVE_OPTIMIZATION_FLAGS
|
||||
|
||||
dnl Add the special gcc flags.
|
||||
CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
|
||||
@@ -880,10 +877,7 @@ PHP_ARG_ENABLE([debug],
|
||||
if test "$PHP_DEBUG" = "yes"; then
|
||||
PHP_DEBUG=1
|
||||
ZEND_DEBUG=yes
|
||||
changequote({,})
|
||||
CFLAGS=`echo "$CFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
|
||||
CXXFLAGS=`echo "$CXXFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
|
||||
changequote([,])
|
||||
PHP_REMOVE_OPTIMIZATION_FLAGS
|
||||
dnl Add -O0 only if GCC or ICC is used.
|
||||
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -O0"
|
||||
|
||||
@@ -115,10 +115,7 @@ dnl Discard optimization flags when debugging is enabled.
|
||||
if test "$PHP_DEBUG" = "yes"; then
|
||||
PHP_DEBUG=1
|
||||
ZEND_DEBUG=yes
|
||||
changequote({,})
|
||||
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'`
|
||||
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'`
|
||||
changequote([,])
|
||||
PHP_REMOVE_OPTIMIZATION_FLAGS
|
||||
dnl Add -O0 only if GCC or ICC is used.
|
||||
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -O0"
|
||||
|
||||
Reference in New Issue
Block a user