diff mbox

RFA: fix PR bootstrap/58572

Message ID 87a9h5ttbp.fsf@fleche.redhat.com
State New
Headers show

Commit Message

Tom Tromey Nov. 15, 2013, 6:26 p.m. UTC
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  <tromey@redhat.com>

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

Comments

Jeff Law Nov. 15, 2013, 9:41 p.m. UTC | #1
On 11/15/13 11:26, Tom Tromey wrote:
> 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  <tromey@redhat.com>
>
> 	PR bootstrap/58572:
> 	* Makefile.in: Rebuild.
> 	* Makefile.tpl ([+compare-target+]): Don't remove previous stage.
But isn't the whole point of bootstrap-lean to remove those directories 
during the build?

jeff
Richard Biener Nov. 15, 2013, 9:59 p.m. UTC | #2
Jeff Law <law@redhat.com> wrote:
>On 11/15/13 11:26, Tom Tromey wrote:
>> 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  <tromey@redhat.com>
>>
>> 	PR bootstrap/58572:
>> 	* Makefile.in: Rebuild.
>> 	* Makefile.tpl ([+compare-target+]): Don't remove previous stage.
>But isn't the whole point of bootstrap-lean to remove those directories
>
>during the build?

If it reduces peak disk usage yes. These don't, no?  That said, we could also 'fix' the dependencies at that point?

Richard.

>jeff
Tom Tromey Nov. 15, 2013, 10:05 p.m. UTC | #3
>>>>> "Jeff" == Jeff Law <law@redhat.com> writes:

Jeff> But isn't the whole point of bootstrap-lean to remove those
Jeff> directories during the build?

Yeah, but I think they are still mostly removed.
We just keep the "last previous" stage around for the benefit of
"install".

It's possible I'm missing something, though, since I haven't ever even
tried bootstrap-lean before.

Tom
Tom Tromey Nov. 15, 2013, 10:07 p.m. UTC | #4
>>>>> "Richard" == Richard Biener <richard.guenther@gmail.com> writes:

Richard> If it reduces peak disk usage yes. These don't, no?  That said, we
Richard> could also 'fix' the dependencies at that point?

That seems to defeat the purpose of having the dependencies.
Really it's been a bug that these dependencies were omitted.
It's possible (though I admit unlikely) that the older code could have
hidden a bug.

Tom
diff mbox

Patch

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 +]