Received: from eggs.gnu.org ([208.118.235.92]:53547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeX2P-0006Dt-3U for qemu-devel@nongnu.org; Tue, 12 Jun 2012 15:46:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeX2N-0003pe-CW for qemu-devel@nongnu.org; Tue, 12 Jun 2012 15:46:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeX2N-0003ou-4K for qemu-devel@nongnu.org; Tue, 12 Jun 2012 15:45:59 -0400 Date: Tue, 12 Jun 2012 16:46:35 -0300 From: Eduardo Habkost Message-ID: <20120612194634.GA28937@otherpad.lan.raisama.net> References: <1338973398-1284-1-git-send-email-avi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1338973398-1284-1-git-send-email-avi@redhat.com> Subject: Re: [Qemu-devel] [PATCH] configure: fix -enable-debug with newer toolchains List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, Anthony Liguori On Wed, Jun 06, 2012 at 12:03:18PM +0300, Avi Kivity wrote: > Fedora 17's toolchain wants optimization enabled for _FORTIFY_SOURCE; > so disable _FORTIFY_SOURCE when debugging. > > Signed-off-by: Avi Kivity I was bitten by this problem too. The patch fixes it for me. Tested-by: Eduardo Habkost Reviewed-by: Eduardo Habkost The patch changes behavior a bit, by moving -D_FORTIFY_SOURCE to CFLAGS instead of QEMU_CFLAGS, but it sounds like a good idea to keep the -O option and -D_FORTIFY_SOURCE close together (anybody overriding/removing -O on CFLAGS on the make command-line would need to take care of -D_FORTIFY_SOURCE as well). > --- > configure | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/configure b/configure > index 1f338f8..88d9c5b 100755 > --- a/configure > +++ b/configure > @@ -255,7 +255,6 @@ QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" > QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" > QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" > QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" > -QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" > QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu" > if test "$debug_info" = "yes"; then > CFLAGS="-g $CFLAGS" > @@ -2851,7 +2850,7 @@ fi > # After here, no more $cc or $ld runs > > if test "$debug" = "no" ; then > - CFLAGS="-O2 $CFLAGS" > + CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS" > fi > > # Consult white-list to determine whether to enable werror > -- > 1.7.10.1 > -- Eduardo