mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01: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:
10
configure.ac
10
configure.ac
@@ -846,8 +846,9 @@ if test "$PHP_GCOV" = "yes"; then
|
||||
|
||||
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'`
|
||||
dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
|
||||
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([,])
|
||||
|
||||
dnl Add the special gcc flags.
|
||||
@@ -866,8 +867,9 @@ 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'`
|
||||
dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
|
||||
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([,])
|
||||
dnl Add -O0 only if GCC or ICC is used.
|
||||
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
|
||||
|
||||
Reference in New Issue
Block a user