PR bootstrap/58572 was inadvertently caused by the automatic dependency
patch series.

The symptoms are that "make bootstrap-lean" will cause a subsequent
"make install" to fail.

The bug is that the automatic dependency code is picking up in-tree
dependencies that were omitted by the old manual dependency tracking.
You can see this by grepping for "libstdc" in $build/gcc/.deps/*.

However, the "compare" step of "make bootstrap-lean" removes the
previous build tree.  This causes these dependencies to be unresolved,
and "make" thinks that the objects need to be rebuilt.  This rebuild is
done with the system compiler, causing errors.

This patch fixes the bug by removing the previous-stage-removal code
from the top-level "compare" target.

Tested by "make boostrap-clean; make install".

Let me know what you think.

Tom

2013-11-15  Tom Tromey  <tro...@redhat.com>

        PR bootstrap/58572:
        * Makefile.in: Rebuild.
        * Makefile.tpl ([+compare-target+]): Don't remove previous stage.

diff --git a/Makefile.in b/Makefile.in
index f9e8e0d..a5e0583 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3,7 +3,8 @@
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 
2011
+#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+#   2010, 2011, 2013
 #   Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
@@ -45292,10 +45293,6 @@ compare:
          echo Comparison successful.; \
        fi ; \
        $(STAMP) compare
-       if $(LEAN); then \
-         rm -rf stage2-*; \
-         $(STAMP) stage2-lean; \
-       fi
 
 
 
@@ -45666,10 +45663,6 @@ compare3:
          echo Comparison successful.; \
        fi ; \
        $(STAMP) compare3
-       if $(LEAN); then \
-         rm -rf stage3-*; \
-         $(STAMP) stage3-lean; \
-       fi
 
 
 
diff --git a/Makefile.tpl b/Makefile.tpl
index 92f3f61..bb137ed 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -6,7 +6,8 @@ in
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 
2011
+#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+#   2010, 2011, 2013
 #   Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
@@ -1605,11 +1606,7 @@ do-clean: clean-stage[+id+]
        else \
          echo Comparison successful.; \
        fi ; \
-       $(STAMP) [+compare-target+][+ IF prev +]
-       if $(LEAN); then \
-         rm -rf stage[+prev+]-*; \
-         $(STAMP) stage[+prev+]-lean; \
-       fi[+ ENDIF prev +]
+       $(STAMP) [+compare-target+]
 [+ ENDIF compare-target +]
 
 [+ IF bootstrap-target +]

Reply via email to