configure.ac (--with-build-config): New.
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 3 Sep 2009 05:55:57 +0000 (05:55 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 3 Sep 2009 05:55:57 +0000 (05:55 +0000)
ChangeLog:
* configure.ac (--with-build-config): New.  Set BUILD_CONFIG.
Default to bootstrap-debug only if compare-debug works.
* configure: Rebuilt.
* Makefile.tpl: Make BUILD_CONFIG configure-configurable.
* Makefile.in: Rebuilt.
contrib/ChangeLog:
* bootstrap-debug-big.mk (STAGE2_CFLAGS): Drop -gtoggle.
* bootstrap-debug-lean.mk: Update comments.
(STAGE2_CFLAGS): Likewise.
(do-compare): Don't override.
gcc/ChangeLog:
* doc/invoke.texi (BUILD_CONFIG): Document --with-build-config.
(bootstrap-debug): Explain conditions in which it becomes default.
(bootstrap-debug-big): Rather than duplicate bootstrap-debug,
make it add to it.

From-SVN: r151367

ChangeLog
Makefile.in
Makefile.tpl
config/bootstrap-debug-big.mk
config/bootstrap-debug-lean.mk
configure
configure.ac
contrib/ChangeLog
gcc/ChangeLog
gcc/doc/install.texi

index 2afe28fb32e6efa5624acc9cbffeaeb4aece966b..6c2978002636471c9599712f0d0f9deecbcd6011 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-03  Alexandre Oliva  <aoliva@redhat.com>
+
+       * configure.ac (--with-build-config): New.  Set BUILD_CONFIG.
+       Default to bootstrap-debug only if compare-debug works.
+       * configure: Rebuilt.
+       * Makefile.tpl: Make BUILD_CONFIG configure-configurable.
+       * Makefile.in: Rebuilt.
+
 2009-09-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * MAINTAINERS (OS Port Maintainers): Update my email address.
index b46c5e94d640aaff996f0531809ecdc4c4cbd0ca..044f849d0aa68119104251f1f18530041e5f7b15 100644 (file)
@@ -771,7 +771,7 @@ EXTRA_GCC_FLAGS = \
 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
 
 @if gcc
-BUILD_CONFIG = bootstrap-debug
+BUILD_CONFIG = @BUILD_CONFIG@
 ifneq ($(BUILD_CONFIG),)
 include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
 endif
index b4e02d5582195d97da230ba0a8211f7919618458..6c63d950fc6d0d4c0dee3c13a504e3aa32b9e7c9 100644 (file)
@@ -619,7 +619,7 @@ EXTRA_GCC_FLAGS = \
 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
 
 @if gcc
-BUILD_CONFIG = bootstrap-debug
+BUILD_CONFIG = @BUILD_CONFIG@
 ifneq ($(BUILD_CONFIG),)
 include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
 endif
index e657735e3b33d8b4ff5cf8085d11319bf0814f95..855ddc2a642446e7e6266780a2b12e056977c2c4 100644 (file)
@@ -3,6 +3,6 @@
 # stage3, it generates dumps during stage2 and stage3, saving them all
 # until the final compare.
 
-STAGE2_CFLAGS += -gtoggle -fdump-final-insns
+STAGE2_CFLAGS += -fdump-final-insns
 STAGE3_CFLAGS += -fdump-final-insns
 do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
index 5666d3f2119daf1267e236e9f4cfde8b8de1cfa8..e215280b09f36ff240bf997afc70167534076ea1 100644 (file)
@@ -1,11 +1,11 @@
-# This BUILD_CONFIG option is a bit like bootstrap-debug, but in
-# addition to comparing stripped object files, it also compares
-# compiler internal state during stage3.
+# This BUILD_CONFIG option is a bit like bootstrap-debug, but rather
+# than comparing stripped object files, it compares compiler internal
+# state during stage3.  Both can be used simultaneously.
 
-# This makes it slower than bootstrap-debug, for there's additional
-# dumping and recompilation during stage3.  bootstrap-debug-big can
-# avoid the recompilation, if plenty of disk space is available.
+# This makes it slower than bootstrap-debug alone, for there's
+# additional dumping and recompilation during stage3.
+# bootstrap-debug-big can avoid the recompilation, if plenty of disk
+# space is available.
 
-STAGE2_CFLAGS += -gtoggle -fcompare-debug=
+STAGE2_CFLAGS += -fcompare-debug=
 STAGE3_CFLAGS += -fcompare-debug
-do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
index e04c6b74751510bba10b68c393dfa7104ff6c8aa..c8f2fcf15161c5b4916db4fc6ac7b275736089da 100755 (executable)
--- a/configure
+++ b/configure
@@ -631,6 +631,7 @@ build_tooldir
 tooldir
 GCC_SHLIB_SUBDIR
 RPATH_ENVVAR
+BUILD_CONFIG
 CXXFLAGS_FOR_TARGET
 CFLAGS_FOR_TARGET
 DEBUG_PREFIX_CFLAGS_FOR_TARGET
@@ -6569,13 +6570,42 @@ $as_echo "$as_me: WARNING: trying to bootstrap a cross compiler" >&2;}
 esac
 
 # Adjust the toplevel makefile according to whether bootstrap was selected.
-case "$enable_bootstrap" in
+case $enable_bootstrap in
   yes)
-    bootstrap_suffix=bootstrap ;;
+    bootstrap_suffix=bootstrap
+    BUILD_CONFIG=bootstrap-debug
+    ;;
   no)
-    bootstrap_suffix=no-bootstrap ;;
+    bootstrap_suffix=no-bootstrap
+    BUILD_CONFIG=
+    ;;
 esac
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default BUILD_CONFIG" >&5
+$as_echo_n "checking for default BUILD_CONFIG... " >&6; }
+if test "x${with_build_config}" != x; then
+  BUILD_CONFIG=$with_build_config
+else
+  case $BUILD_CONFIG in
+  bootstrap-debug)
+    if echo "int f (void) { return 0; }" > conftest.c &&
+       ${CC} -c conftest.c &&
+       mv conftest.o conftest.o.g0 &&
+       ${CC} -c -g conftest.c &&
+       mv conftest.o conftest.o.g &&
+       ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g; then
+      :
+    else
+      BUILD_CONFIG=
+    fi
+    rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
+    ;;
+  esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CONFIG" >&5
+$as_echo "$BUILD_CONFIG" >&6; }
+
+
 for module in ${build_configdirs} ; do
   if test -z "${no_recursion}" \
      && test -f ${build_subdir}/${module}/Makefile; then
index 48fa58019ed02ffe886e5c2d07d7d1e84cd95232..caff7e5af132c96af4413b19b7231fc5a385b6cd 100644 (file)
@@ -2459,13 +2459,40 @@ case "$have_compiler:$host:$target:$enable_bootstrap" in
 esac
 
 # Adjust the toplevel makefile according to whether bootstrap was selected.
-case "$enable_bootstrap" in
+case $enable_bootstrap in
   yes)
-    bootstrap_suffix=bootstrap ;;
+    bootstrap_suffix=bootstrap
+    BUILD_CONFIG=bootstrap-debug
+    ;;
   no)
-    bootstrap_suffix=no-bootstrap ;;
+    bootstrap_suffix=no-bootstrap
+    BUILD_CONFIG=
+    ;;
 esac
 
+AC_MSG_CHECKING(for default BUILD_CONFIG)
+if test "x${with_build_config}" != x; then
+  BUILD_CONFIG=$with_build_config
+else
+  case $BUILD_CONFIG in
+  bootstrap-debug)
+    if echo "int f (void) { return 0; }" > conftest.c &&
+       ${CC} -c conftest.c &&
+       mv conftest.o conftest.o.g0 &&
+       ${CC} -c -g conftest.c &&
+       mv conftest.o conftest.o.g &&
+       ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g; then
+      :
+    else
+      BUILD_CONFIG=
+    fi
+    rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
+    ;;
+  esac
+fi
+AC_MSG_RESULT($BUILD_CONFIG)
+AC_SUBST(BUILD_CONFIG)
+
 for module in ${build_configdirs} ; do
   if test -z "${no_recursion}" \
      && test -f ${build_subdir}/${module}/Makefile; then
index 77d7170046465c96f0529cd23d17f481e641ccb4..d15084e0bbfa00c406ae83c155f1c946ebe2bfdf 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-03  Alexandre Oliva  <aoliva@redhat.com>
+
+       * bootstrap-debug-big.mk (STAGE2_CFLAGS): Drop -gtoggle.
+       * bootstrap-debug-lean.mk: Update comments.
+       (STAGE2_CFLAGS): Likewise.
+       (do-compare): Don't override.
+
 2009-09-01  Alexandre Oliva  <aoliva@redhat.com>
 
        * compare-debug: Look for .gkd files and compare them.
index 70203526678202cc2ed243d1259d50620acf0500..fef23a8e251ba873dca4fd9a6282337277812d1f 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-03  Alexandre Oliva  <aoliva@redhat.com>
+
+       * doc/invoke.texi (BUILD_CONFIG): Document --with-build-config.
+       (bootstrap-debug): Explain conditions in which it becomes default.
+       (bootstrap-debug-big): Rather than duplicate bootstrap-debug,
+       make it add to it.
+
 2009-09-03  Namhyung Kim  <namhyung@gmail.com>
 
        * doc/invoke.texi (Optimize Options): Move
index 9dea18c43caa89892d28dc4e83727a7b5cbd88f0..e0098bc156aceb41795bbf38d7e59b042e600f3f 100644 (file)
@@ -2080,11 +2080,13 @@ the one you are building on: for example, you could build a
 @code{powerpc64-unknown-linux-gnu} host.  In this case, pass
 @option{--enable-bootstrap} to the configure script.
 
-@code{BUILD_CONFIG} can be used to bring in additional customization to
-the build.  It can be set to a whitespace-separated list of names.  For
-each such @code{NAME}, top-level @file{config/@code{NAME}.mk} will be
-included by the top-level @file{Makefile}, bringing in any settings it
-contains.  Some examples are:
+@code{BUILD_CONFIG} can be used to bring in additional customization
+to the build.  It can be set to a whitespace-separated list of names.
+For each such @code{NAME}, top-level @file{config/@code{NAME}.mk} will
+be included by the top-level @file{Makefile}, bringing in any settings
+it contains.  The default @code{BUILD_CONFIG} can be set using the
+configure option @option{--with-build-config=@code{NAME}...}.  Some
+examples of supported build configurations are:
 
 @table @asis
 @item @samp{bootstrap-O1}
@@ -2097,19 +2099,22 @@ Analogous to @code{bootstrap-O1}.
 
 @item @samp{bootstrap-debug}
 Verifies that the compiler generates the same executable code, whether
-or not it is asked to emit debug information.  To this end, this option
-builds stage2 host programs without debug information, and uses
+or not it is asked to emit debug information.  To this end, this
+option builds stage2 host programs without debug information, and uses
 @file{contrib/compare-debug} to compare them with the stripped stage3
 object files.  If @code{BOOT_CFLAGS} is overridden so as to not enable
 debug information, stage2 will have it, and stage3 won't.  This option
-is enabled by default when GCC bootstrapping is enabled: in addition to
-better test coverage, it makes default bootstraps faster and leaner.
+is enabled by default when GCC bootstrapping is enabled, if
+@code{strip} can turn object files compiled with and without debug
+info into identical object files.  In addition to better test
+coverage, this option makes default bootstraps faster and leaner.
 
 @item @samp{bootstrap-debug-big}
-In addition to the checking performed by @code{bootstrap-debug}, this
-option saves internal compiler dumps during stage2 and stage3 and
-compares them as well, which helps catch additional potential problems,
-but at a great cost in terms of disk space.
+Rather than comparing stripped object files, as in
+@code{bootstrap-debug}, this option saves internal compiler dumps
+during stage2 and stage3 and compares them as well, which helps catch
+additional potential problems, but at a great cost in terms of disk
+space.  It can be specified in addition to @samp{bootstrap-debug}.
 
 @item @samp{bootstrap-debug-lean}
 This option saves disk space compared with @code{bootstrap-debug-big},