This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [toplevel] Toplevel bootstrap fixes 2/4, bootstrap-lean
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 Dec 2005 14:25:54 +0100
- Subject: Re: [toplevel] Toplevel bootstrap fixes 2/4, bootstrap-lean
- References: <43A917CA.6050302@lu.unisi.ch>
Paolo Bonzini wrote:
This patch implements bootstrap-lean for the new toplevel bootstrap. It
is simple to do it by passing recursively a variable which is set to
either ":" (for non-lean bootstraps) or the empty string (for lean
bootstraps).
All bootstrap targets have a `lean' variation, even `bootstrap2'. With
this patch, as a small benefit over GCC-directory bootstrap, we get
profiledbootstrap-lean.
Yesterday I forgot the patch and then the battery power exhausted before
I could pick it up and send it, so gere it is. I also tested it with a
"make -j4 bootstrap-lean" to cover the possibility of race conditions.
It applies on top of part 3/4, and I tested them together.
Ok for gcc/src?
Paolo
2005-12-22 Paolo Bonzini <bonzini@gnu.org>
* Makefile.def (NOT_LEAN): Pass.
* Makefile.tpl (NOT_LEAN): Define.
(stage[+id+]-start): Accept that the previous directory does not
exist, if the bootstrap is lean.
(stage[+id+]-bubble): Invoke lean bootstrap commands after
stage[+id+]-start. Use a makefile variable instead of a
configure substitution.
([+compare-target+]): Likewise.
([+bootstrap-target+]-lean): New.
* Makefile.in: Regenerate.
* configure.in: Remove lean bootstrap support from here.
* configure: Regenerate.
diff -u base-gcc-src/Makefile.def peak-gcc-src/Makefile.def
--- base-gcc-src/Makefile.def 2005-12-21 17:24:58.000000000 +0100
+++ peak-gcc-src/Makefile.def 2005-12-22 09:37:10.000000000 +0100
@@ -236,6 +236,9 @@
flags_to_pass = { flag= STRIP_FOR_TARGET ; };
flags_to_pass = { flag= WINDRES_FOR_TARGET ; };
+// Miscellaneous
+flags_to_pass = { flag= NOT_LEAN ; };
+
// Inter-module dependencies
// Build modules
diff -u base-gcc-src/Makefile.tpl peak-gcc-src/Makefile.tpl
--- base-gcc-src/Makefile.tpl 2005-12-22 14:02:09.000000000 +0100
+++ peak-gcc-src/Makefile.tpl 2005-12-22 11:49:00.000000000 +0100
@@ -1222,6 +1222,9 @@
stage:
@: $(MAKE); $(stage)
+# Disable commands for lean bootstrap.
+NOT_LEAN=#
+
# We name the build directories for the various stages "stage1-gcc",
# "stage2-gcc","stage3-gcc", etc.
@@ -1278,12 +1281,12 @@
@cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \
mkdir stage[+id+]-[+module+]; \
mv stage[+id+]-[+module+] [+module+] [+ IF prev +] ; \
- mv stage[+prev+]-[+module+] prev-[+module+] ; : [+ ENDIF prev +]
+ mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +]
@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
@[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \
mkdir stage[+id+]-$(TARGET_SUBDIR); \
mv stage[+id+]-$(TARGET_SUBDIR) $(TARGET_SUBDIR) [+ IF prev +] ; \
- mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) ; : [+ ENDIF prev +]
+ mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage[+prev+]-lean [+ ENDIF prev +]
stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +]
@if [+ module +]
@@ -1302,15 +1305,16 @@
# remade, but not reconfigured. The next stage (if any) will not be
# reconfigured as well.
.PHONY: stage[+id+]-bubble
-stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +][+IF lean +]
- @bootstrap_lean@-rm -rf stage[+lean+]-* ; $(STAMP) stage[+lean+]-lean[+ ENDIF lean +]
+stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
if test -f stage[+id+]-lean [+
IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +] ; then \
echo Skipping rebuild of stage[+id+] ; \
else \
- $(MAKE) stage[+id+]-start; \
+ $(MAKE) stage[+id+]-start; \[+IF lean +]
+ $(NOT_LEAN) rm -rf stage[+lean+]-* ; \
+ $(NOT_LEAN) $(STAMP) stage[+lean+]-lean ; \[+ ENDIF lean +]
$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
fi[+ IF compare-target +]
$(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +]
@@ -1354,11 +1358,12 @@
true; \
fi ; \
$(STAMP) [+compare-target+][+ IF prev +]
- @bootstrap_lean@-rm -rf stage[+prev+]-* ; $(STAMP) stage[+prev+]-lean[+ ENDIF prev +]
+ $(NOT_LEAN) rm -rf stage[+prev+]-*
+ $(NOT_LEAN) $(STAMP) stage[+prev+]-lean[+ ENDIF prev +]
[+ ENDIF compare-target +]
[+ IF bootstrap-target +]
-.PHONY: [+bootstrap-target+]
+.PHONY: [+bootstrap-target+] [+bootstrap-target+]-lean
[+bootstrap-target+]:
echo stage[+id+] > stage_final
@r=`${PWD_COMMAND}`; export r; \
@@ -1368,6 +1373,16 @@
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
+
+[+bootstrap-target+]-lean:
+ echo stage[+id+] > stage_final
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOT_LEAN= stage[+id+]-bubble
+ @: $(MAKE); $(unstage)
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
[+ ENDIF bootstrap-target +]
# Rules to wipe a stage and all the following ones, also used for cleanstrap
diff -u base-gcc-src/configure.in peak-gcc-src/configure.in
--- base-gcc-src/configure.in 2005-12-22 14:01:21.000000000 +0100
+++ peak-gcc-src/configure.in 2005-12-22 09:37:10.000000000 +0100
@@ -1736,7 +1736,7 @@
# not to nest @if/@endif pairs, because configure will not warn you at all.
AC_ARG_ENABLE([bootstrap],
-[ --enable-bootstrap[=lean] Enable bootstrapping [no]],,
+[ --enable-bootstrap Enable bootstrapping [yes if native build]],,
enable_bootstrap=default)
# Issue errors and warnings for invalid/strange bootstrap combinations.
@@ -1757,17 +1757,17 @@
enable_bootstrap=no ;;
# We have a compiler and we are in a native configuration, bootstrap is ok
- yes:$build:$build:yes | yes:$build:$build:lean)
+ yes:$build:$build:yes)
;;
# Other configurations, but we have a compiler. Assume the user knows
# what he's doing.
- yes:*:*:yes | yes:*:*:lean)
+ yes:*:*:yes)
AC_MSG_WARN([trying to bootstrap a cross compiler])
;;
# No compiler: if they passed --enable-bootstrap explicitly, fail
- no:*:*:yes | no:*:*:lean)
+ no:*:*:yes)
AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
# Fail if wrong command line
@@ -1779,15 +1779,10 @@
# Adjust the toplevel makefile according to whether bootstrap was selected.
case "$enable_bootstrap" in
yes)
- bootstrap_lean='#'
- bootstrap_suffix=bootstrap ;;
- lean)
- bootstrap_lean=''
bootstrap_suffix=bootstrap ;;
no)
bootstrap_suffix=no-bootstrap ;;
esac
-AC_SUBST(bootstrap_lean)
for module in ${build_configdirs} ; do
if test -z "${no_recursion}" \