This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfc] Skip non-default multilib and libstdc++-v3 debug builds in bootstrap builds


The attached patch avoids building the non-default multilib and libstdc++-v3 debug builds in bootstrap builds during bootstrap builds, resulting in some speedup for bootstrap builds for targets with multilibs enabled. On x86_64-linux-gnu with 64/32/x32 multilibs enabled and the libstdc++ debug build enabled the bootstrap with -j8 takes 34:10 without, and with the patch 26:55, making the build ~20% faster (standard languages plus go enabled). It's faster because it avoids the rather sequential libcc/libstdc++/libgomp configury during stage1 and stage2. The gain by not building the libstdc++ debug library is not that measurable, the config is copied, there is no separate configure run. Is relying on stage_current/stage_final the correct approach? Should that be enabled using a configure option, or by default?

Matthias

# DP: Skip non-default multilib and libstdc++-v3 debug builds in bootstrap builds

--- a/src/config-ml.in
+++ b/src/config-ml.in
@@ -498,6 +498,17 @@
 # Tests like `if [ -n "$multidirs" ]' require it.
 multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'`
 
+# stage1 and stage2 builds of the non-default multilib configurations
+# are not needed; skip these to save some build time.
+if [ -f ../../stage_final ] && [ -f ../../stage_current ]; then
+    stage_final=`cat ../../stage_final`
+    stage_current=`cat ../../stage_current`
+    if [ "$stage_current" != "$stage_final" ]; then
+	echo "Skip `basename $ml_realsrcdir` non-default multilibs for bootstrap stage $stage_current"
+	multidirs=
+    fi
+fi
+
 # Add code to library's top level makefile to handle building the multilib
 # subdirs.
 
--- a/src/libstdc++-v3/acinclude.m4
+++ b/src/libstdc++-v3/acinclude.m4
@@ -2503,7 +2503,20 @@
 AC_DEFUN([GLIBCXX_ENABLE_DEBUG], [
   AC_MSG_CHECKING([for additional debug build])
   GLIBCXX_ENABLE(libstdcxx-debug,$1,,[build extra debug library])
+  if test x$enable_libstdcxx_debug = xyes; then
+    if test -f $toplevel_builddir/../stage_final && test -f $toplevel_builddir/../stage_current; then
+      stage_final=`cat $toplevel_builddir/../stage_final`
+      stage_current=`cat $toplevel_builddir/../stage_current`
+      if test x$stage_current != x$stage_final ; then
+	skip_debug_build=yes
+	enable_libstdcxx_debug=no
+      fi
+    fi
+  fi
   AC_MSG_RESULT($enable_libstdcxx_debug)
+  if test x$skip_debug_build = xyes ; then
+    AC_MSG_NOTICE([Skip libstdc++-v3 debug build for bootstrap stage $stage_current])
+  fi
   GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test $enable_libstdcxx_debug = yes)
 ])
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]