[Bug bootstrap/17817] [4.0 Regression] restage[1,2,3] and then bootstrap no longer cause build dir to be rebuilt

kcook at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Oct 4 20:16:00 GMT 2004


------- Additional Comments From kcook at gcc dot gnu dot org  2004-10-04 20:16 -------
Subject: PATCH:  restage[1,2,3] and then bootstrap no
 longer cause build dir to be rebuilt

 > The real problem is that if you are testing an optimization, and it
 > causes the generator programs to fail, you can no longer do
 >
 > make restage1
 > <fix>
 > make bootstrap
 > and have it work, because it will no longer rebuild the generator
 > programs with stage1, and will still try to run the broken programs.
 >
 > I have to actually rm -rf build/*
 > make restage1 (which rebuilds them now, and didn't before)
 > rm -rf build/*
 > make bootstrap
 > to get it to do what it used to.
 >
 > This is somewhat of a pain in the ass to find and fix bugs that you
 > cause in the generator programs, which is not an uncommon occurrence
 > when testing new optimizations.

Clearly a valid reason to rebuild the generator executables at each 
stage.  This patch stages the build directory.

Lightly tested to see that requested functionality is restored.

OK to install if full bootstrap succeeds?


2004-10-04  Kelley Cook  <kcook@gcc.gnu.org>

	* Makefile.in: Stage the build directory too.

--- gcc-orig/gcc/Makefile.in	2004-10-01 03:42:49.000000000 -0400
+++ gcc-snapshot/gcc/Makefile.in	2004-10-04 14:27:19.506704700 -0400
@@ -119,7 +119,7 @@ T_ADAFLAGS =
 # See below for how to change them for certain systems.
 
 # List of language subdirectories.
-SUBDIRS =@subdirs@
+SUBDIRS =@subdirs@ build
 
 # Selection of languages to be made.
 CONFIG_LANGUAGES = @all_languages@
@@ -3899,6 +3899,7 @@ stage1-start:
 # If SPECS is overridden, make sure it is `installed' as specs.
 	-mv $(SPECS) stage1/specs
 	-mv $(STAGEMOVESTUFF) stage1
+	-mv build/* stage1/build
 	-cp -p $(STAGECOPYSTUFF) stage1
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
 # dir will work properly.
@@ -3937,6 +3938,7 @@ stage2-start:
 # If SPECS is overridden, make sure it is `installed' as specs.
 	-mv $(SPECS) stage2/specs
 	-mv $(STAGEMOVESTUFF) stage2
+	-mv build/* stage2/build
 	-cp -p $(STAGECOPYSTUFF) stage2
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
 # dir will work properly.
@@ -3971,6 +3973,7 @@ stage3-start:
 # If SPECS is overridden, make sure it is `installed' as specs.
 	-mv $(SPECS) stage3/specs
 	-mv $(STAGEMOVESTUFF) stage3
+	-mv build/* stage3/build
 	-cp -p $(STAGECOPYSTUFF) stage3
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
 # dir will work properly.
@@ -4005,6 +4008,7 @@ stage4-start:
 # If SPECS is overridden, make sure it is `installed' as specs.
 	-mv $(SPECS) stage4/specs
 	-mv $(STAGEMOVESTUFF) stage4
+	-mv build/* stage4/build
 	-cp -p $(STAGECOPYSTUFF) stage4
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
 # dir will work properly.
@@ -4037,6 +4041,7 @@ stageprofile-start:
 	   if [ -d stageprofile/$$dir ] ; then true ; else mkdir stageprofile/$$dir ; fi ; \
 	 done
 	-mv $(STAGEMOVESTUFF) stageprofile
+	-mv build/* stageprofile/build
 	-cp -p $(STAGECOPYSTUFF) stageprofile
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
 # dir will work properly.
@@ -4069,6 +4074,7 @@ stagefeedback-start:
 	   if [ -d stagefeedback/$$dir ] ; then true ; else mkdir stagefeedback/$$dir ; fi ; \
 	 done
 	-mv $(STAGEMOVESTUFF) stagefeedback
+	-mv build/* stagefeedback/build
 	-cp -p $(STAGECOPYSTUFF) stagefeedback
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
 # dir will work properly.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17817



More information about the Gcc-bugs mailing list