* [Qemu-devel] [PATCH v3 1.3] build: compile translate.o with -fno-gcse option on GCC 4.6.x and 4.7.[012]
@ 2012-11-28 8:40 Paolo Bonzini
2012-11-28 17:27 ` Andreas Färber
2012-11-28 21:37 ` Anthony Liguori
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-11-28 8:40 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, kraxel
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 <pbonzini@redhat.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v3 1.3] build: compile translate.o with -fno-gcse option on GCC 4.6.x and 4.7.[012]
2012-11-28 8:40 [Qemu-devel] [PATCH v3 1.3] build: compile translate.o with -fno-gcse option on GCC 4.6.x and 4.7.[012] Paolo Bonzini
@ 2012-11-28 17:27 ` Andreas Färber
2012-11-28 21:37 ` Anthony Liguori
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Färber @ 2012-11-28 17:27 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: peter.maydell, Bruce Rogers, qemu-devel, kraxel
Am 28.11.2012 09:40, schrieb Paolo Bonzini:
> 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 <pbonzini@redhat.com>
Tested-by: Andreas Färber <afaerber@suse.de>
> ---
> 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))
FWIW this line looks overly long.
> +int main(void) { return 0; }
> +#else
> +#error No bug in this compiler.
Interesting logic. :)
Andreas
> +#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
>
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v3 1.3] build: compile translate.o with -fno-gcse option on GCC 4.6.x and 4.7.[012]
2012-11-28 8:40 [Qemu-devel] [PATCH v3 1.3] build: compile translate.o with -fno-gcse option on GCC 4.6.x and 4.7.[012] Paolo Bonzini
2012-11-28 17:27 ` Andreas Färber
@ 2012-11-28 21:37 ` Anthony Liguori
1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2012-11-28 21:37 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: peter.maydell, kraxel
Paolo Bonzini <pbonzini@redhat.com> 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 <pbonzini@redhat.com>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-28 21:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28 8:40 [Qemu-devel] [PATCH v3 1.3] build: compile translate.o with -fno-gcse option on GCC 4.6.x and 4.7.[012] Paolo Bonzini
2012-11-28 17:27 ` Andreas Färber
2012-11-28 21:37 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).