delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/11/14/08:04:24

Message-ID: <382E9F5A.D811575F@softhome.net>
Date: Sun, 14 Nov 1999 13:39:06 +0200
From: Laurynas Biveinis <lauras AT softhome DOT net>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: lt,en
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: DJGPP Workers <djgpp-workers AT delorie DOT com>,
Andris Pavenis <pavenis AT lanet DOT lv>
Subject: Re: GCC porting questions
References: <Pine DOT SUN DOT 3 DOT 91 DOT 991114134426 DOT 19268E-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

This is a multi-part message in MIME format.
--------------FC232DA1A9A301BE16D16A2E
Content-Type: text/plain; charset=iso-8859-4
Content-Transfer-Encoding: 7bit

Eli Zaretskii wrote:
> On Sun, 14 Nov 1999, Andris Pavenis wrote:
> > Also crash in some places will force to do manual cleanup before one can
> > restart (hint: try 'make configure-target-libio', cancel it with Ctrl-C
> > and rerun, of course all this after 'make all-gcc')

> Or perhaps the GCC Makefile doesn't tell Make about all the files that
> eavery target produces, in which case you will indeed be left with
> corrupted intermediate files.

AFAIK, that's the case. IIRC, Debian GNU/Linux GCC maintainers have a patch 
for GCC's makefile which makes it restartable. If anyone cares, it is attached.

Laurynas Biveinis
--------------FC232DA1A9A301BE16D16A2E
Content-Type: text/plain; charset=iso-8859-4;
 name="bootstrap.dpatch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bootstrap.dpatch"

#! /bin/sh -e

# DP: Make bootstrap: restartable at any point
# DP: From: Donn Terry <donn AT interix DOT com>

if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

#:
<!--X-Subject: Re: Patch: Make bootstrap: restartable at any point &#45;&#45; take 2 -->
<!--X-From: Donn Terry <donn AT interix DOT com> -->
<!--X-Date: 28 May 1999 21:34:49 &#45;0000 -->
<!--X-Message-Id: 374F0AA0 DOT 590D7C1E AT interix DOT com -->
<!--X-Content-Type: multipart/mixed -->
<!--X-Reference: 374D788C DOT 4A61AEB8 AT interix DOT com -->
<!--X-Reference: oryaiaus2r DOT fsf AT lua DOT lbi DOT dcc DOT unicamp DOT br -->
<!--X-Head-End-->
Make bootstrap: restartable at any point.

This is in response to a discussion on this topic.  This is "take 2"          |
which should work with parallel builds, though I haven't tested that.         |

When doing a make bootstrap, it's hard to know (at least when
not throughly versed in the process details) how to restart
after making a fix.  In general, retyping "make bootstrap"
will do the wrong thing (particularly if the host and target
compilers object files are incompatible!)

This change keeps track of the stages completed.  The old 
bootstrap2[234] (and *-lean) targets are rewritten, but work the
same.

I've tested this by doing a make bootstrap (on CVS sources as of              |
last night) and by typing 'make bootstrap' after it's done,                   |
in which case it thinks a moment and does nothing. (Which is exactly
the right answer.)

I've also done a complete regression, with no surprises.                      |

I tested whether stopping/restarting at a few arbitrary points along the
way works with older sources, but haven't tested it real recently,
except to do a ^C halfway through a testbuild at one point.                   |
Again, if it works at all, it should work as well as it ever did.
I specficially did test it during the period where make bootstrap
wasn't succeeding for me, and it helped a LOT in being able to pick up
where I left off.  

An interesting side-effect: make bootstrap-lean after a make bootstrap        |
JUST cleans out stage1, with no unwanted consequences.                        |


Fri May 28 15:27:02 1999  Donn Terry (donn AT interix DOT com)
	* Makefile.in: restructure bootstrap stages to allow 
	clean restart after failure.

diff -urP egcs.source.old/gcc/Makefile.in egcs.source/gcc/Makefile.in
--- egcs.source.old/gcc/Makefile.in	Sun May 23 13:39:21 1999
+++ egcs.source/gcc/Makefile.in	Thu May 27 16:59:42 1999
@@ -2360,6 +2360,8 @@ clean: mostlyclean intl.clean lang.clean
 	  rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
 	fi ; fi
 	-rm -fr stage1 stage2 stage3 stage4
+	-rm -f boot_stage_a boot_stage_b boot_stage_c boot_stage_d
+	-rm -f boot_stage_e boot_stage_f
 
 # Delete all files that users would normally create
 # while building and installing GCC.
@@ -2924,33 +2926,83 @@ diff:
 	  $(LANG_DIFF_EXCLUDES) \
 	  gcc-$(oldversion) gcc-$(version) &gt; gcc-$(oldversion)-$(version).diff
 
-bootstrap bootstrap-lean: force
+
 # Only build the C compiler for stage1, because that is the only one that
 # we can guarantee will build with the native compiler, and also it is the
 # only thing useful for building stage2.
-	$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
-	$(MAKE) stage1
+boot_stage_a:
+	+$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
+	touch boot_stage_a
+	echo ---------------------- stage a complete ---------------------
+
+boot_stage_b:
+	+$(MAKE) stage1
+	touch boot_stage_b
+	echo ---------------------- stage b complete ---------------------
+
 # This used to define ALLOCA as empty, but that would lead to bad results
 # for a subsequent `make install' since that would not have ALLOCA empty.
 # To prevent `make install' from compiling alloca.o and then relinking cc1
 # because alloca.o is newer, we permit these recursive makes to compile
 # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
-	$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
-	$(MAKE) stage2
-	-if test $@ = bootstrap-lean; then rm -rf stage1; else true; fi
-	$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
+boot_stage_c:
+	+$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
+	touch boot_stage_c
+	echo ---------------------- stage c complete ---------------------
 
-bootstrap2 bootstrap2-lean: force
-	$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
-	$(MAKE) stage2
-	-if test $@ = bootstrap2-lean; then rm -rf stage1; else true; fi
-	$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
+boot_stage_d:
+	+$(MAKE) stage2
+	touch boot_stage_d
+	echo ---------------------- stage d complete ---------------------
 
-bootstrap3 bootstrap3-lean: force
-	$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
+boot_stage_e:
+	+$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
+	touch boot_stage_e
+	echo ---------------------- stage e complete ---------------------
+
+# Only bootstrap4 uses stage f.
+boot_stage_f:
+	+$(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)"
+	touch boot_stage_f
+	echo ---------------------- stage f complete ---------------------
+
+boot_clean_stage1:
+	rm -rf stage1
+
+# This next little bit is the way it is for parallel builds.  It's simply
+# a chain of stages which DO have to be done sequentially.
+
+bootstrap_a:              boot_stage_a
+bootstrap_b:  bootstrap_a boot_stage_b
+bootstrap_c:  bootstrap_b boot_stage_c
+bootstrap_d:  bootstrap_c boot_stage_d
+bootstrap_e:  bootstrap_d boot_stage_e
+bootstrap: force bootstrap_e
+
+bootstrap-lean_a:                   boot_stage_a
+bootstrap-lean_b:  bootstrap-lean_a boot_stage_b
+bootstrap-lean_c:  bootstrap-lean_b boot_stage_c
+bootstrap-lean_d:  bootstrap-lean_c boot_stage_d
+bootstrap-lean_e:  bootstrap-lean_d boot_clean_stage1
+bootstrap-lean_f:  bootstrap-lean_e boot_stage_e
+bootstrap-lean: force bootstrap-lean_f
+
+bootstrap2_c:               boot_stage_c
+bootstrap2_d:  bootstrap2_c boot_stage_d
+bootstrap2_e:  bootstrap2_d boot_stage_e
+bootstrap2: force bootstrap2_e
+
+bootstrap2-lean_c:                    boot_stage_c
+bootstrap2-lean_d:  bootstrap2-lean_c boot_stage_d
+bootstrap2-lean_e:  bootstrap2-lean_d boot_clean_stage1
+bootstrap2-lean_f:  bootstrap2-lean_e boot_stage_e
+bootstrap2-lean: force bootstrap2-lean_f
+
+bootstrap3 bootstrap3-lean: force boot_stage_e
+
+# Only bootstrap4 uses stage f.
+bootstrap4 bootstrap4-lean: force boot_stage_f
 
-bootstrap4 bootstrap4-lean: force
-	$(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)"
 
 # Compare the object files in the current directory with those in the
 # stage2 directory.

--------------FC232DA1A9A301BE16D16A2E--


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019