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]

Re: Improving parallel build


* Tom Tromey wrote on Sun, Mar 30, 2008 at 08:04:30PM CEST:
> >>>>> "Ralf" == Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
> 
> Ralf> I'm wondering whether I should just retract the patch, for safety.
> 
> A simple patch like this that helps build times is pretty appealing.
> Personally I'd prefer to give it a shot.  We can always back it out
> again if we run into trouble.

OK, here's the patch redone in terms of your automatic dependency patch.
What's really funny is that it's almost a strict subset of your patch
(modulo reordering in Makefile.in, copyright year updates, merging in
the obj-c++ typo patch, and documentation), which is why I haven't put
my name on most ChangeLog entries.  So there is some benefit from all
your work.  :-)

The patch passed parallel bootstrap of languages != ada, obj-c++,
giving virtually the same speedup, and passed the
  touch $top_srcdir/gcc/Makefile.in && make -j2 cc1

test using make 3.80.  Sequential bootstrap of all languages is running.
OK for trunk if that passes?  OK if I apply this or would you like to,
Tom?

Thanks,
Ralf

gcc/ChangeLog:
2008-03-31  Tom Tromey  <tromey@redhat.com>
	    Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* config/m68k/t-uclinux (generated_files): Add sysroot-suffix.h.
	* config/bfin/t-bfin-linux (generated_files): Add
	linux-sysroot-suffix.h.
	* doc/install.texi (Prerequisites): Require make 3.80.
	* doc/sourcebuild.texi (Front End Directory): Document new
	variable.
	* Makefile.in (generated_files): New variable.
	(ALL_HOST_OBJS): New variable.
	($(ALL_HOST_OBJS)): New target.

gcc/java/ChangeLog:
2008-03-31  Tom Tromey  <tromey@redhat.com>

	* Make-lang.in (java_OBJS): New variable.

gcc/objc/ChangeLog:
2008-03-31  Tom Tromey  <tromey@redhat.com>

	* Make-lang.in (objc_OBJS): New variable.

gcc/objcp/ChangeLog:
2008-03-31  Tom Tromey  <tromey@redhat.com>

	* Make-lang.in (obj-c++_OBJS): New variable.

gcc/cp/ChangeLog:
2008-03-31  Tom Tromey  <tromey@redhat.com>

	* Make-lang.in (c++_OBJS): New variable.

gcc/fortran/ChangeLog:
2008-03-31  Tom Tromey  <tromey@redhat.com>

	* Make-lang.in (fortran_OBJS): New variable.

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 407e2fe..388d966 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1255,6 +1255,15 @@ OBJS = $(OBJS-common) $(OBJS-md) $(OBJS-archive)
 
 OBJS-onestep = libbackend.o $(OBJS-archive)
 
+# This lists all host object files, whether they are included in this
+# compilation or not.
+ALL_HOST_OBJS = $(GCC_OBJS) $(C_OBJS) $(OBJS) libbackend.o \
+  @TREEBROWSER@ main.o gccspec.o version.o intl.o prefix.o cppspec.o \
+  $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) \
+  $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) \
+  mips-tfile.o mips-tdump.o \
+  $(PROTO_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS)
+
 BACKEND = main.o @TREEBROWSER@ libbackend.a $(CPPLIB) $(LIBDECNUMBER)
 
 MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
@@ -3008,6 +3017,16 @@ $(simple_generated_c:insn-%.c=s-%): s-%: build/gen%$(build_exeext) \
 	$(SHELL) $(srcdir)/../move-if-change tmp-$*.c insn-$*.c
 	$(STAMP) s-$*
 
+generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \
+       $(simple_generated_h) $(simple_generated_c) specs.h \
+       tree-check.h genrtl.h insn-modes.h tm-preds.h tm-constrs.h \
+       $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h
+
+# In order for parallel make to really start compiling the expensive
+# objects from $(OBJS-common) as early as possible, build all their
+# prerequisites strictly before all objects.
+$(ALL_HOST_OBJS) : | $(generated_files)
+
 # genconstants needs to run before insn-conditions.md is available
 # (because the constants may be used in the conditions).
 insn-constants.h: s-constants; @true
diff --git a/gcc/config/bfin/t-bfin-linux b/gcc/config/bfin/t-bfin-linux
index f79ccac..849dcee 100644
--- a/gcc/config/bfin/t-bfin-linux
+++ b/gcc/config/bfin/t-bfin-linux
@@ -33,3 +33,5 @@ linux-sysroot-suffix.h: $(srcdir)/config/bfin/print-sysroot-suffix.sh
 	$(SHELL) $(srcdir)/config/bfin/print-sysroot-suffix.sh \
 	  "$(SYSTEM_HEADER_DIR)/../.." "$(MULTILIB_MATCHES)" \
 	  "$(MULTILIB_OPTIONS)" > $@
+
+generated_files += linux-sysroot-suffix.h
diff --git a/gcc/config/m68k/t-uclinux b/gcc/config/m68k/t-uclinux
index 3ee359d..f860672 100644
--- a/gcc/config/m68k/t-uclinux
+++ b/gcc/config/m68k/t-uclinux
@@ -14,3 +14,5 @@ sysroot-suffix.h: $(srcdir)/config/m68k/print-sysroot-suffix.sh
 	$(SHELL) $(srcdir)/config/m68k/print-sysroot-suffix.sh \
 	  "$(SYSTEM_HEADER_DIR)/../.." "$(MULTILIB_MATCHES)" \
 	  "$(MULTILIB_OPTIONS)" > $@
+
+generated_files += sysroot-suffix.h
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 6207ed1..e1447b0 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -86,6 +86,8 @@ CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
 # Language-specific object files for C++.
 CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS)
 
+c++_OBJS = $(CXX_OBJS) dummy-checksum.o cc1plus-checksum.o cp/g++spec.o
+
 # Use strict warnings for this front end.
 cp-warn = $(STRICT_WARN) $(CXX_COMPAT_WARN)
 
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 45d982c..027b169 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -285,7 +285,7 @@ requirements.
 Necessary to uncompress GCC @command{tar} files when source code is
 obtained via FTP mirror sites.
 
-@item GNU make version 3.79.1 (or later)
+@item GNU make version 3.80 (or later)
 
 You must have GNU make installed to build GCC@.
 
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index d4b7753..f2ad7f8 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -642,6 +642,9 @@ all generated files in the source directory that are not checked into
 CVS, but should not delete anything checked into CVS@.
 @end table
 
+@file{Make-lang.in} must also define a variable @code{@var{lang}_OBJS}
+to a list of host object files that are used by that language.
+
 @item lang.opt
 This file registers the set of switches that the front end accepts on
 the command line, and their @option{--help} text.  @xref{Options}.
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index 1702b9f..d9056a1 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -1,6 +1,7 @@
 # -*- makefile -*-
 # Top level makefile fragment for GNU gfortran, the GNU Fortran 95 compiler.
-# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
+# Foundation, Inc.
 # Contributed by Paul Brook <paul@nowt.org
 # and Steven Bosscher <s.bosscher@student.tudelft.nl>
 
@@ -67,6 +68,8 @@ F95_OBJS = $(F95_PARSER_OBJS) \
     fortran/trans-intrinsic.o fortran/trans-io.o fortran/trans-openmp.o \
     fortran/trans-stmt.o fortran/trans-types.o
 
+fortran_OBJS = $(F95_OBJS) gfortranspec.o
+
 #
 # Define the names for selecting gfortran in LANGUAGES.
 fortran: f951$(exeext)
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index bfb57a3..d799c13 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -1,7 +1,7 @@
 # Top level -*- makefile -*- fragment for the GNU compiler for the Java(TM)
 # language.
 #   Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-#   2005, 2006, 2007 Free Software Foundation, Inc.
+#   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -90,6 +90,8 @@ JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
 
 JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o intl.o
 
+java_OBJS = $(sort $(JAVA_OBJS) $(JCFDUMP_OBJS) $(JVGENMAIN_OBJS)) jvspec.o
+
 # Use strict warnings for this front end.
 java-warn = $(STRICT_WARN)
 
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index af68816..93a0042 100644
--- a/gcc/objc/Make-lang.in
+++ b/gcc/objc/Make-lang.in
@@ -1,6 +1,6 @@
 # Top level -*- makefile -*- fragment for GNU Objective-C
-#   Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
+#   2008 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -49,6 +49,8 @@ objc-warn = $(STRICT_WARN)
 # Language-specific object files for Objective C.
 OBJC_OBJS = objc/objc-lang.o objc/objc-act.o
 
+objc_OBJS = $(OBJC_OBJS) cc1obj-checksum.o
+
 cc1obj-dummy$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS)
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
 	      $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o \
diff --git a/gcc/objcp/Make-lang.in b/gcc/objcp/Make-lang.in
index 97b79c2..695df4d 100644
--- a/gcc/objcp/Make-lang.in
+++ b/gcc/objcp/Make-lang.in
@@ -1,5 +1,5 @@
 # Top level -*- makefile -*- fragment for GNU Objective-C++
-#   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
 #   Contributed by Ziemowit Laski  <zlaski@apple.com>
 
 #This file is part of GCC.
@@ -51,6 +51,8 @@ objcp-warn = $(STRICT_WARN) -DOBJCPLUS -I$(srcdir)/objc -I$(srcdir)/cp
 OBJCXX_OBJS = objcp/objcp-act.o objcp/objcp-lang.o objcp/objcp-decl.o \
    $(CXX_AND_OBJCXX_OBJS)
 
+obj-c++_OBJS = $(OBJCXX_OBJS) cc1objplus-checksum.o
+
 cc1objplus-dummy$(exeext): $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) \
 		$(LIBDEPS)
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \


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