OSDN Git Service

ChangeLog:
authorAlexandre Oliva <aoliva@redhat.com>
Mon, 7 Sep 2009 00:44:07 +0000 (00:44 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 7 Sep 2009 00:44:07 +0000 (00:44 +0000)
* configure.ac (with-build-config): Document.  Handle without.
Handle missing argument.
* configure: Rebuilt.
config/ChangeLog:
* bootstrap-debug-big.mk (STAGE2_CFLAGS): Drop -gtoggle.
* bootstrap-debug-lean.mk: Update comments.
(STAGE2_CFLAGS): Likewise.
(do-compare): Don't override.
ChangeLog:
* configure.ac (with-build-config): Document.  Handle without.
Handle missing argument.
* configure: Rebuilt.

12 files changed:
ChangeLog
Makefile.in
Makefile.tpl
config/ChangeLog
config/bootstrap-debug-big.mk [new file with mode: 0644]
config/bootstrap-debug-ckovw.mk [new file with mode: 0644]
config/bootstrap-debug-lean.mk [new file with mode: 0644]
config/bootstrap-debug-lib.mk [new file with mode: 0644]
config/bootstrap-debug.mk
config/bootstrap-time.mk [new file with mode: 0644]
configure
configure.ac

index 8742ef0..d971a37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2009-09-04  Alexandre Oliva  <aoliva@redhat.com>
+
+       * configure.ac (with-build-config): Document.  Handle without.
+       Handle missing argument.
+       * configure: Rebuilt.
+
+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-01  Alexandre Oliva  <aoliva@redhat.com>
+
+       * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug.
+       * Makefile.in: Rebuilt.
+
 2009-09-02  Paolo Bonzini  <bonzini@gnu.org>
 
        * Makefile.tpl (AWK): Fix typo.
index 7e11774..044f849 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 =
+BUILD_CONFIG = @BUILD_CONFIG@
 ifneq ($(BUILD_CONFIG),)
 include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
 endif
index f12252b..6c63d95 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 =
+BUILD_CONFIG = @BUILD_CONFIG@
 ifneq ($(BUILD_CONFIG),)
 include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
 endif
index f45a3cc..ba8fd00 100644 (file)
@@ -1,3 +1,19 @@
+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>
+
+       * bootstrap-debug.mk: Add comments.
+       * bootstrap-debug-big.mk: New.
+       * bootstrap-debug-lean.mk: New.
+       * bootstrap-debug-ckovw.mk: Add comments.
+       * bootstrap-debug-lib.mk: Drop CFLAGS for stages.  Use -g0
+       for TFLAGS in stage1.  Drop -fvar-tracking-assignments-toggle.
+
 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * override.m4 (_GCC_AUTOCONF_VERSION): Bump to 2.64.
diff --git a/config/bootstrap-debug-big.mk b/config/bootstrap-debug-big.mk
new file mode 100644 (file)
index 0000000..855ddc2
--- /dev/null
@@ -0,0 +1,8 @@
+# This BUILD_CONFIG option is a bit like bootstrap-debug-lean, but it
+# trades space for speed: instead of recompiling programs during
+# stage3, it generates dumps during stage2 and stage3, saving them all
+# until the final compare.
+
+STAGE2_CFLAGS += -fdump-final-insns
+STAGE3_CFLAGS += -fdump-final-insns
+do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
diff --git a/config/bootstrap-debug-ckovw.mk b/config/bootstrap-debug-ckovw.mk
new file mode 100644 (file)
index 0000000..909b904
--- /dev/null
@@ -0,0 +1,16 @@
+# This BUILD_CONFIG option is to be used along with
+# bootstrap-debug-lean and bootstrap-debug-lib in a full bootstrap, to
+# check that all host and target files are built with -fcompare-debug.
+
+# These arrange for a simple warning to be issued if -fcompare-debug
+# is not given.
+# BOOT_CFLAGS += -fcompare-debug="-w%n-fcompare-debug not overridden"
+# TFLAGS += -fcompare-debug="-w%n-fcompare-debug not overridden"
+
+# GCC_COMPARE_DEBUG="-w%n-fcompare-debug not overridden";
+
+FORCE_COMPARE_DEBUG = \
+       GCC_COMPARE_DEBUG=$${GCC_COMPARE_DEBUG--fcompare-debug-not-overridden}; \
+       export GCC_COMPARE_DEBUG;
+POSTSTAGE1_HOST_EXPORTS += $(FORCE_COMPARE_DEBUG)
+BASE_TARGET_EXPORTS += $(FORCE_COMPARE_DEBUG)
diff --git a/config/bootstrap-debug-lean.mk b/config/bootstrap-debug-lean.mk
new file mode 100644 (file)
index 0000000..e215280
--- /dev/null
@@ -0,0 +1,11 @@
+# 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 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 += -fcompare-debug=
+STAGE3_CFLAGS += -fcompare-debug
diff --git a/config/bootstrap-debug-lib.mk b/config/bootstrap-debug-lib.mk
new file mode 100644 (file)
index 0000000..32fdf4d
--- /dev/null
@@ -0,0 +1,12 @@
+# This BUILD_CONFIG option tests that target libraries built during
+# stage3 would have generated the same executable code if they were
+# compiled with -g0.
+
+# It uses -g0 rather than -gtoggle because -g is default on target
+# library builds, and toggling it where it's supposed to be disabled
+# breaks e.g. crtstuff on ppc.
+
+STAGE1_TFLAGS += -g0 -fcompare-debug=
+STAGE2_TFLAGS += -fcompare-debug=
+STAGE3_TFLAGS += -fcompare-debug=-g0
+do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
index 521be82..4138924 100644 (file)
@@ -1,2 +1,12 @@
-STAGE2_CFLAGS += -g0
+# This BUILD_CONFIG option builds checks that toggling debug
+# information generation doesn't affect the generated object code.
+
+# It is very lightweight: in addition to not performing any additional
+# compilation (unlike bootstrap-debug-lean), it actually speeds up
+# stage2, for no debug information is generated when compiling with
+# the unoptimized stage1.
+
+# For more thorough testing, see bootstrap-debug-lean.mk
+
+STAGE2_CFLAGS += -gtoggle
 do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
diff --git a/config/bootstrap-time.mk b/config/bootstrap-time.mk
new file mode 100644 (file)
index 0000000..08a8dff
--- /dev/null
@@ -0,0 +1,2 @@
+BOOT_CFLAGS += -time=$(shell pwd)/time.log
+TFLAGS += -time=$(shell pwd)/time.log
index e04c6b7..3b6cd2d 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
@@ -768,6 +769,7 @@ enable_objc_gc
 with_build_sysroot
 with_debug_prefix_map
 enable_bootstrap
+with_build_config
 enable_serial_configure
 with_build_time_tools
 enable_maintainer_mode
@@ -1497,6 +1499,8 @@ Optional Packages:
                           use sysroot as the system root during the build
   --with-debug-prefix-map='A=B C=D ...'
                              map A to B, C to D ... in debug information
+--with-build-config='NAME NAME2...'
+                          Use config/NAME.mk build configuration
   --with-build-time-tools=PATH
                           use given path to find target tools during the build
 
@@ -6569,13 +6573,53 @@ $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; }
+
+
+# Check whether --with-build-config was given.
+if test "${with_build_config+set}" = set; then :
+  withval=$with_build_config; case $with_build_config in
+   yes) with_build_config= ;;
+   no) with_build_config= BUILD_CONFIG= ;;
+   esac
+fi
+
+
+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 48fa580..592a8e3 100644 (file)
@@ -2459,13 +2459,49 @@ 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)
+
+AC_ARG_WITH([build-config],
+  [--with-build-config='NAME NAME2...'
+                          Use config/NAME.mk build configuration],
+  [case $with_build_config in
+   yes) with_build_config= ;;
+   no) with_build_config= BUILD_CONFIG= ;;
+   esac])
+
+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