mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Fix removal of optimization cflags in debug builds (#9647)
Discard known '-O' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
This commit is contained in:
parent
c4d9a37e81
commit
182fee1447
2 changed files with 9 additions and 6 deletions
10
configure.ac
10
configure.ac
|
@ -840,8 +840,9 @@ if test "$PHP_GCOV" = "yes"; then
|
||||||
|
|
||||||
dnl Remove all optimization flags from CFLAGS.
|
dnl Remove all optimization flags from CFLAGS.
|
||||||
changequote({,})
|
changequote({,})
|
||||||
CFLAGS=`echo "$CFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
|
dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
|
||||||
CXXFLAGS=`echo "$CXXFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
|
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O\([0-9gsz]\|fast\|\)\([\t ]\|$\)//g'`
|
||||||
|
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O\([0-9gsz]\|fast\|\)\([\t ]\|$\)//g'`
|
||||||
changequote([,])
|
changequote([,])
|
||||||
|
|
||||||
dnl Add the special gcc flags.
|
dnl Add the special gcc flags.
|
||||||
|
@ -860,8 +861,9 @@ if test "$PHP_DEBUG" = "yes"; then
|
||||||
PHP_DEBUG=1
|
PHP_DEBUG=1
|
||||||
ZEND_DEBUG=yes
|
ZEND_DEBUG=yes
|
||||||
changequote({,})
|
changequote({,})
|
||||||
CFLAGS=`echo "$CFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
|
dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
|
||||||
CXXFLAGS=`echo "$CXXFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
|
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O\([0-9gsz]\|fast\|\)\([\t ]\|$\)//g'`
|
||||||
|
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O\([0-9gsz]\|fast\|\)\([\t ]\|$\)//g'`
|
||||||
changequote([,])
|
changequote([,])
|
||||||
dnl Add -O0 only if GCC or ICC is used.
|
dnl Add -O0 only if GCC or ICC is used.
|
||||||
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
|
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
|
||||||
|
|
|
@ -116,8 +116,9 @@ if test "$PHP_DEBUG" = "yes"; then
|
||||||
PHP_DEBUG=1
|
PHP_DEBUG=1
|
||||||
ZEND_DEBUG=yes
|
ZEND_DEBUG=yes
|
||||||
changequote({,})
|
changequote({,})
|
||||||
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'`
|
dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
|
||||||
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'`
|
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O\([0-9gsz]\|fast\|\)\([\t ]\|$\)//g'`
|
||||||
|
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O\([0-9gsz]\|fast\|\)\([\t ]\|$\)//g'`
|
||||||
changequote([,])
|
changequote([,])
|
||||||
dnl Add -O0 only if GCC or ICC is used.
|
dnl Add -O0 only if GCC or ICC is used.
|
||||||
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
|
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue