From d7a8a04eb92ea9fd16f99c5744134b13bde6e620 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 9 Aug 2024 13:56:08 +0200 Subject: [PATCH] Autotools: Remove too basic optimization flag cleanup The optimization flags are removed in configure.ac when using the '--enable-debug' configure option (which also adds the '-O0'). When using '--enable-debug-assertions' option, the optimization flags ideally shouldn't be removed and this case never actually happen because the CFLAGS at this point in ZEND_INIT contain all sorts of other flags also, so it's redundant as it never gets executed. Closes GH-15305 --- Zend/Zend.m4 | 3 --- 1 file changed, 3 deletions(-) diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index c7693b3380a..b7b44fb1408 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -177,9 +177,6 @@ AH_TEMPLATE([ZEND_DEBUG], AS_VAR_IF([ZEND_DEBUG], [yes], [ AC_DEFINE([ZEND_DEBUG], [1]) echo " $CFLAGS" | grep ' -g' >/dev/null || CFLAGS="$CFLAGS -g" - if test "$CFLAGS" = "-g -O2"; then - CFLAGS=-g - fi ], [AC_DEFINE([ZEND_DEBUG], [0])]) AS_VAR_IF([GCC], [yes],