From 78767fd9cf5581827603c154235fd36ecf075e31 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 19 Jul 2011 18:33:25 +0000 Subject: [PATCH] configure.ac: Add --enable-build-poststage1-with-cxx. ./: * configure.ac: Add --enable-build-poststage1-with-cxx. If set, make C++ a boot_language. Set and substitute POSTSTAGE1_CONFIGURE_FLAGS. * Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): New variable. (STAGE[+id+]_CONFIGURE_FLAGS): Add $(POSTSTAGE1_CONFIGURE_FLAGS). * configure, Makefile.in: Rebuild. gcc/: * doc/install.texi (Configuration): Document --enable-build-poststage1-with-cxx. From-SVN: r176480 --- ChangeLog | 9 +++++++++ Makefile.in | 34 ++++++++++++++++++++++++++++------ Makefile.tpl | 9 ++++++++- configure | 38 +++++++++++++++++++++++++++++++------- configure.ac | 32 +++++++++++++++++++++++++------- gcc/ChangeLog | 5 +++++ gcc/doc/install.texi | 7 +++++++ 7 files changed, 113 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8af7cbc6985..b8ff5f286ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-07-19 Ian Lance Taylor + + * configure.ac: Add --enable-build-poststage1-with-cxx. If set, + make C++ a boot_language. Set and substitute + POSTSTAGE1_CONFIGURE_FLAGS. + * Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): New variable. + (STAGE[+id+]_CONFIGURE_FLAGS): Add $(POSTSTAGE1_CONFIGURE_FLAGS). + * configure, Makefile.in: Rebuild. + 2011-07-19 Vladimir Makarov * MAINTAINERS (Register Allocation): Move myself from reviewers to diff --git a/Makefile.in b/Makefile.in index 3b8e6c74859..6df70593a26 100644 --- a/Makefile.in +++ b/Makefile.in @@ -415,6 +415,7 @@ TFLAGS = STAGE_CFLAGS = $(BOOT_CFLAGS) STAGE_TFLAGS = $(TFLAGS) STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@ +POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@ # Defaults for stage 1; some are overridden below. @@ -425,7 +426,10 @@ STAGE1_CXXFLAGS = $(CXXFLAGS) STAGE1_CXXFLAGS = $(STAGE1_CFLAGS) @endif target-libstdc++-v3-bootstrap STAGE1_TFLAGS = $(STAGE_TFLAGS) -STAGE1_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE1_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) # Defaults for stage 2; some are overridden below. STAGE2_CFLAGS = $(STAGE_CFLAGS) @@ -435,7 +439,10 @@ STAGE2_CXXFLAGS = $(CXXFLAGS) STAGE2_CXXFLAGS = $(STAGE2_CFLAGS) @endif target-libstdc++-v3-bootstrap STAGE2_TFLAGS = $(STAGE_TFLAGS) -STAGE2_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE2_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) # Defaults for stage 3; some are overridden below. STAGE3_CFLAGS = $(STAGE_CFLAGS) @@ -445,7 +452,10 @@ STAGE3_CXXFLAGS = $(CXXFLAGS) STAGE3_CXXFLAGS = $(STAGE3_CFLAGS) @endif target-libstdc++-v3-bootstrap STAGE3_TFLAGS = $(STAGE_TFLAGS) -STAGE3_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE3_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) # Defaults for stage 4; some are overridden below. STAGE4_CFLAGS = $(STAGE_CFLAGS) @@ -455,7 +465,10 @@ STAGE4_CXXFLAGS = $(CXXFLAGS) STAGE4_CXXFLAGS = $(STAGE4_CFLAGS) @endif target-libstdc++-v3-bootstrap STAGE4_TFLAGS = $(STAGE_TFLAGS) -STAGE4_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE4_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) # Defaults for stage profile; some are overridden below. STAGEprofile_CFLAGS = $(STAGE_CFLAGS) @@ -465,7 +478,10 @@ STAGEprofile_CXXFLAGS = $(CXXFLAGS) STAGEprofile_CXXFLAGS = $(STAGEprofile_CFLAGS) @endif target-libstdc++-v3-bootstrap STAGEprofile_TFLAGS = $(STAGE_TFLAGS) -STAGEprofile_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGEprofile_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) # Defaults for stage feedback; some are overridden below. STAGEfeedback_CFLAGS = $(STAGE_CFLAGS) @@ -475,7 +491,10 @@ STAGEfeedback_CXXFLAGS = $(CXXFLAGS) STAGEfeedback_CXXFLAGS = $(STAGEfeedback_CFLAGS) @endif target-libstdc++-v3-bootstrap STAGEfeedback_TFLAGS = $(STAGE_TFLAGS) -STAGEfeedback_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGEfeedback_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) # Only build the C compiler for stage1, because that is the only one that @@ -493,6 +512,9 @@ STAGE1_LANGUAGES = @stage1_languages@ # the last argument when conflicting --enable arguments are passed. # * Likewise, we force-disable coverage flags, since the installed # compiler probably has never heard of them. +# * Don't remove this, because above we added +# POSTSTAGE1_CONFIGURE_FLAGS to STAGE_CONFIGURE_FLAGS, which +# we don't want for STAGE1_CONFIGURE_FLAGS. STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \ --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" diff --git a/Makefile.tpl b/Makefile.tpl index 0d2a0bfff2d..08d8b2f8b47 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -418,6 +418,7 @@ TFLAGS = STAGE_CFLAGS = $(BOOT_CFLAGS) STAGE_TFLAGS = $(TFLAGS) STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@ +POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@ [+ FOR bootstrap-stage +] # Defaults for stage [+id+]; some are overridden below. @@ -428,7 +429,10 @@ STAGE[+id+]_CXXFLAGS = $(CXXFLAGS) STAGE[+id+]_CXXFLAGS = $(STAGE[+id+]_CFLAGS) @endif target-libstdc++-v3-bootstrap STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS) -STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE[+id+]_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) [+ ENDFOR bootstrap-stage +] # Only build the C compiler for stage1, because that is the only one that @@ -446,6 +450,9 @@ STAGE1_LANGUAGES = @stage1_languages@ # the last argument when conflicting --enable arguments are passed. # * Likewise, we force-disable coverage flags, since the installed # compiler probably has never heard of them. +# * Don't remove this, because above we added +# POSTSTAGE1_CONFIGURE_FLAGS to STAGE[+id+]_CONFIGURE_FLAGS, which +# we don't want for STAGE1_CONFIGURE_FLAGS. STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \ --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" diff --git a/configure b/configure index 0097ab1ccb4..40314d6cbd8 100755 --- a/configure +++ b/configure @@ -556,6 +556,7 @@ enable_option_checking=no ac_subst_vars='LTLIBOBJS LIBOBJS compare_exclusions +POSTSTAGE1_CONFIGURE_FLAGS stage2_werror_flag stage1_checking stage1_cflags @@ -749,6 +750,7 @@ enable_libada enable_libssp enable_static_libjava enable_build_with_cxx +enable_build_poststage1_with_cxx with_mpc with_mpc_include with_mpc_lib @@ -1465,6 +1467,8 @@ Optional Features: --enable-static-libjava[=ARG] build static libjava [default=no] --enable-build-with-cxx build with C++ compiler instead of C compiler + --enable-build-poststage1-with-cxx + build stages 2 and 3 with C++, not C --disable-ppl-version-check disable check for PPL version --enable-cloog-backend[=BACKEND] @@ -4988,6 +4992,15 @@ else fi +# Build stage1 with C and build stages 2 and 3 with C++. +# Check whether --enable-build-poststage1-with-cxx was given. +if test "${enable_build_poststage1_with_cxx+set}" = set; then : + enableval=$enable_build_poststage1_with_cxx; ENABLE_BUILD_POSTSTAGE1_WITH_CXX=$enableval +else + ENABLE_BUILD_POSTSTAGE1_WITH_CXX=yes +fi + + # Used for setting $lt_cv_objdir { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } @@ -6181,9 +6194,11 @@ if test -d ${srcdir}/gcc; then exit 1 fi - if test "$language" = "c++" \ - && test "$ENABLE_BUILD_WITH_CXX" = "yes"; then - boot_language=yes + if test "$language" = "c++"; then + if test "$ENABLE_BUILD_WITH_CXX" = "yes" \ + || test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then + boot_language=yes + fi fi case ,${enable_languages}, in @@ -6937,10 +6952,10 @@ $as_echo "$as_me: WARNING: trying to bootstrap a cross compiler" >&2;} ;; esac -case ",$enable_languages,:$ENABLE_BUILD_WITH_CXX:$enable_bootstrap" in - *,c++,*:yes:yes) ;; - *:yes:yes) - as_fn_error "bootstrapping with --enable-build-with-cxx requires c++ in --enable-languages" "$LINENO" 5 +case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in + *,c++,*:*:*) ;; + *:*,yes,*:yes) + as_fn_error "bootstrapping with --enable-build-with-cxx or --enable-build-postage1-with-cxx requires c++ in --enable-languages" "$LINENO" 5 ;; esac @@ -13990,6 +14005,15 @@ case ${enable_werror} in esac +# If using ENABLE_BUILD_POSTSTAGE1_WITH_CXX, pass +# --enable-build-with-cxx after stage1. +if test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then + POSTSTAGE1_CONFIGURE_FLAGS=--enable-build-with-cxx +else + POSTSTAGE1_CONFIGURE_FLAGS= +fi + + # Specify what files to not compare during bootstrap. compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*" diff --git a/configure.ac b/configure.ac index 7085eeaf235..c53d381b727 100644 --- a/configure.ac +++ b/configure.ac @@ -1140,6 +1140,13 @@ AC_ARG_ENABLE(build-with-cxx, ENABLE_BUILD_WITH_CXX=$enableval, ENABLE_BUILD_WITH_CXX=no) +# Build stage1 with C and build stages 2 and 3 with C++. +AC_ARG_ENABLE(build-poststage1-with-cxx, +[AS_HELP_STRING([--enable-build-poststage1-with-cxx], + [build stages 2 and 3 with C++, not C])], +ENABLE_BUILD_POSTSTAGE1_WITH_CXX=$enableval, +ENABLE_BUILD_POSTSTAGE1_WITH_CXX=yes) + # Used for setting $lt_cv_objdir _LT_CHECK_OBJDIR @@ -1710,9 +1717,11 @@ if test -d ${srcdir}/gcc; then exit 1 fi - if test "$language" = "c++" \ - && test "$ENABLE_BUILD_WITH_CXX" = "yes"; then - boot_language=yes + if test "$language" = "c++"; then + if test "$ENABLE_BUILD_WITH_CXX" = "yes" \ + || test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then + boot_language=yes + fi fi case ,${enable_languages}, in @@ -2411,10 +2420,10 @@ case "$have_compiler:$host:$target:$enable_bootstrap" in ;; esac -case ",$enable_languages,:$ENABLE_BUILD_WITH_CXX:$enable_bootstrap" in - *,c++,*:yes:yes) ;; - *:yes:yes) - AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx requires c++ in --enable-languages]) +case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in + *,c++,*:*:*) ;; + *:*,yes,*:yes) + AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx or --enable-build-postage1-with-cxx requires c++ in --enable-languages]) ;; esac @@ -3202,6 +3211,15 @@ case ${enable_werror} in esac AC_SUBST(stage2_werror_flag) +# If using ENABLE_BUILD_POSTSTAGE1_WITH_CXX, pass +# --enable-build-with-cxx after stage1. +if test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then + POSTSTAGE1_CONFIGURE_FLAGS=--enable-build-with-cxx +else + POSTSTAGE1_CONFIGURE_FLAGS= +fi +AC_SUBST(POSTSTAGE1_CONFIGURE_FLAGS) + # Specify what files to not compare during bootstrap. compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*" diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 507ba8f222a..bac2275466d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-07-19 Ian Lance Taylor + + * doc/install.texi (Configuration): Document + --enable-build-poststage1-with-cxx. + 2011-07-19 Robert Millan * config/mips/gnu-user.h: Copy from linux.h. Update comments. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index fdf17b98056..9b1b037c02a 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1284,6 +1284,13 @@ will try to guess whether the @code{.init_array} and Build GCC using a C++ compiler rather than a C compiler. This is an experimental option which may become the default in a later release. +@item --enable-build-poststage1-with-cxx +When bootstrapping, build stages 2 and 3 of GCC using a C++ compiler +rather than a C compiler. Stage 1 is still built with a C compiler. +This is an experimental option which may become the default in a later +release. This is enabled by default and may be disabled using +@option{--disable-build-poststage1-with-cxx}. + @item --enable-maintainer-mode The build rules that regenerate the Autoconf and Automake output files as well as the GCC master message catalog @file{gcc.pot} are normally -- 2.30.2