From 9978c06c88315dce3071f6c4b284878f34c37c66 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 2 May 2010 21:42:50 -0400 Subject: Add check for buggy version of GCC (Bug#6031). * configure.in: Add check for buggy version of GCC (Bug#6031). * configure: Regenerate * etc/NEWS: Minor tweak to problem description. --- ChangeLog | 4 ++++ configure | 10 ++++++++++ configure.in | 8 ++++++++ etc/PROBLEMS | 2 +- 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a6ed9737245..6936d80ba8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-05-03 Chong Yidong + + * configure.in: Add check for buggy version of GCC (Bug#6031). + 2010-01-31 Juri Linkov * .bzrignore: Add TAGS-LISP. diff --git a/configure b/configure index 977510ee2e0..efb3dc8488e 100755 --- a/configure +++ b/configure @@ -25559,6 +25559,16 @@ fi CFLAGS="$REAL_CFLAGS" CPPFLAGS="$REAL_CPPFLAGS" +## Hack to detect a buggy GCC version. +if test "x$GCC" = xyes \ + && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \ + && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \ + && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then + { { $as_echo "$as_me:$LINENO: error: GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." >&5 +$as_echo "$as_me: error: GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." >&2;} + { (exit 1); exit 1; }; } +fi + #### Find out which version of Emacs this is. version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \ | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` diff --git a/configure.in b/configure.in index 2315c267052..9069895508d 100644 --- a/configure.in +++ b/configure.in @@ -2600,6 +2600,14 @@ dnl Fixme: Use AC_FUNC_MEMCMP since memcmp is used. (Needs libobj replacement.) CFLAGS="$REAL_CFLAGS" CPPFLAGS="$REAL_CPPFLAGS" +## Hack to detect a buggy GCC version. +if test "x$GCC" = xyes \ + && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \ + && test x"`echo $CFLAGS | grep '\-O@<:@23@:>@'`" != x \ + && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then + AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'.]) +fi + #### Find out which version of Emacs this is. [version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \ | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`] diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 63454777080..b3cda374c51 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -167,7 +167,7 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239344 * Crash bugs -** Emacs crashes when running in a terminal, if compiled with gcc-4.5. +** Emacs crashes when running in a terminal, if compiled with GCC 4.5.0 This version of GCC is buggy: see http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6031 -- cgit v1.2.3