This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Don't require C++ bootstrap compiler (PR bootstrap/46810)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 6 Dec 2010 19:34:34 +0100
- Subject: [PATCH] Don't require C++ bootstrap compiler (PR bootstrap/46810)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
The recent go addition resulted in C++ bootstrap compiler being required
unconditionally, because the new autoconf unordered_map/hash_map checks
require C++.
Fixed by only doing the checks when we must have a C++ compiler (i.e.
--enable-build-with-cxx or when the current stage includes Go FE (because
then either the bootstrap compiler has to include C++ for stage1, or
previous stage includes C++).
Bootstrapped/regtested on x86_64-linux and i686-linux, without go and with
go. Ok for trunk?
2010-12-06 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/46810
* configure.ac: Don't AC_LANG_{PUSH,POP}(C++) if
$ENABLE_BUILD_WITH_CXX is not yes and go is not
among $enable_languages.
* configure: Rebuilt.
--- gcc/configure.ac.jj 2010-12-06 08:08:55.000000000 +0100
+++ gcc/configure.ac 2010-12-06 12:32:34.000000000 +0100
@@ -909,17 +909,31 @@ AC_CHECK_HEADER(pthread.h, [have_pthread
gcc_AC_C_CHAR_BIT
AC_C_BIGENDIAN
+# We shouldn't require C++ compiler unless necessary, which is
+# if --enable-build-with-cxx has been given or if go is included in
+# this stage.
+gcc_have_cxx_support=no
+if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
+ gcc_have_cxx_support=yes
+else
+ case ,$enable_languages, in
+ *,go,*) gcc_have_cxx_support=yes ;;
+ esac
+fi
+
# ----------------------
# Checks for C++ headers
# ----------------------
+if test $gcc_have_cxx_support = yes; then
AC_LANG_PUSH(C++)
AC_CHECK_HEADERS(unordered_map)
AC_CHECK_HEADERS(tr1/unordered_map)
AC_CHECK_HEADERS(ext/hash_map)
AC_LANG_POP(C++)
+fi
# --------
# UNSORTED
--- gcc/configure.jj 2010-12-06 12:09:22.000000000 +0100
+++ gcc/configure 2010-12-06 12:32:42.000000000 +0100
@@ -8424,10 +8424,23 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
esac
+# We shouldn't require C++ compiler unless necessary, which is
+# if --enable-build-with-cxx has been given or if go is included in
+# this stage.
+gcc_have_cxx_support=no
+if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
+ gcc_have_cxx_support=yes
+else
+ case ,$enable_languages, in
+ *,go,*) gcc_have_cxx_support=yes ;;
+ esac
+fi
+
# ----------------------
# Checks for C++ headers
# ----------------------
+if test $gcc_have_cxx_support = yes; then
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8610,6 +8623,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS con
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+fi
# --------
# UNSORTED
@@ -17506,7 +17520,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17509 "configure"
+#line 17523 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17612,7 +17626,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17615 "configure"
+#line 17629 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
Jakub