From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdpKS-0004Xx-7e for qemu-devel@nongnu.org; Wed, 28 Nov 2012 16:38:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdpKQ-0001Xf-V0 for qemu-devel@nongnu.org; Wed, 28 Nov 2012 16:38:00 -0500 Received: from mail-ie0-f173.google.com ([209.85.223.173]:46298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdpKQ-0001XY-Q7 for qemu-devel@nongnu.org; Wed, 28 Nov 2012 16:37:58 -0500 Received: by mail-ie0-f173.google.com with SMTP id e13so10323601iej.4 for ; Wed, 28 Nov 2012 13:37:57 -0800 (PST) From: Anthony Liguori In-Reply-To: <1354092023-10897-1-git-send-email-pbonzini@redhat.com> References: <1354092023-10897-1-git-send-email-pbonzini@redhat.com> Date: Wed, 28 Nov 2012 15:37:53 -0600 Message-ID: <87boehs91q.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH v3 1.3] build: compile translate.o with -fno-gcse option on GCC 4.6.x and 4.7.[012] List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, kraxel@redhat.com Paolo Bonzini writes: > These versions of GCC require insane (>2GB) amounts of memory to compile > translate.o. As a countermeasure, disable the culprit optimization pass. > This should fix the buildbot failure for default_x86_64_fedora16. Anyway > this is a good thing to do because people will try to compile 1.3 with > less than 2GB of memory and complain. > > Signed-off-by: Paolo Bonzini Applied. Thanks. Regards, Anthony Liguori > --- > Makefile.target | 3 +++ > configure | 16 ++++++++++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/Makefile.target b/Makefile.target > index 8b658c0..927347b 100644 > --- a/Makefile.target > +++ b/Makefile.target > @@ -143,6 +143,9 @@ GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h > > endif # CONFIG_SOFTMMU > > +# Workaround for http://gcc.gnu.org/PR55489, see configure. > +%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS) > + > nested-vars += obj-y > > # This resolves all nested paths, so it must come last > diff --git a/configure b/configure > index 780b19a..994f731 100755 > --- a/configure > +++ b/configure > @@ -1183,6 +1183,21 @@ for flag in $gcc_flags; do > fi > done > > +# Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and > +# large functions that use global variables. The bug is in all releases of > +# GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in > +# 4.7.3 and 4.8.0. We should be able to delete this at the end of 2013. > +cat > $TMPC << EOF > +#if __GNUC__ == 4 && (__GNUC_MINOR__ == 6 || (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ <= 2)) > +int main(void) { return 0; } > +#else > +#error No bug in this compiler. > +#endif > +EOF > +if compile_prog "-Werror -fno-gcse" "" ; then > + TRANSLATE_OPT_CFLAGS=-fno-gcse > +fi > + > if test "$static" = "yes" ; then > if test "$pie" = "yes" ; then > echo "static and pie are mutually incompatible" > @@ -3662,6 +3677,7 @@ echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak > echo "EXESUF=$EXESUF" >> $config_host_mak > echo "LIBS_QGA+=$libs_qga" >> $config_host_mak > echo "POD2MAN=$POD2MAN" >> $config_host_mak > +echo "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak > > # generate list of library paths for linker script > > -- > 1.8.0