From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyL38-00052W-Ue for qemu-devel@nongnu.org; Fri, 29 May 2015 10:14:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyL35-0004gf-MD for qemu-devel@nongnu.org; Fri, 29 May 2015 10:14:14 -0400 References: <1432897012-1423-1-git-send-email-alex.bennee@linaro.org> <55684995.3070205@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <55684995.3070205@redhat.com> Date: Fri, 29 May 2015 15:14:20 +0100 Message-ID: <877frrii83.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] configure: don't apply -O2 if extra-cflags sets -O List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Paolo Bonzini writes: > On 29/05/2015 12:56, Alex Bennée wrote: >> If your trying to debug and want to force -O0 then don't allow the >> configure script to try and set -O2. You can use --enable-debug but that >> enables a lot more stuff by default. >> >> Signed-off-by: Alex Bennée >> --- >> configure | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/configure b/configure >> index b707429..be1f354 100755 >> --- a/configure >> +++ b/configure >> @@ -4240,7 +4240,10 @@ if test "$gcov" = "yes" ; then >> CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" >> LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" >> elif test "$debug" = "no" ; then >> - CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" >> + if test "${EXTRA_CFLAGS#*-O}" = "$EXTRA_CFLAGS"; then >> + CFLAGS="-O2 $CFLAGS" >> + fi >> + CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" >> fi >> >> ########################################## >> > > Why aren't EXTRA_CFLAGS applied _after_ CFLAGS instead of before? You mean just do: diff --git a/configure b/configure index b707429..f13831a 100755 --- a/configure +++ b/configure @@ -353,7 +353,7 @@ for opt do ;; --cpu=*) cpu="$optarg" ;; - --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" + --extra-cflags=*) QEMU_CFLAGS="$QEMU_CFLAGS $optarg" EXTRA_CFLAGS="$optarg" ;; --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" > > Paolo I guess at the time I was trying to be clean and avoiding multiple -O calls. But I guess that will have the same effect. -- Alex Bennée