fixincl now run at every stage?

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Mon Jan 31 19:17:00 GMT 2000


 > From: Jeffrey A Law <law@cygnus.com>
 > 
 >   In message < 200001311838.NAA12263@caip.rutgers.edu >you write:
 >   > 
 >   > Scanning recent Makefile.in changes, I'm going to hazard a guess that
 >   > this was the culprit:
 >   > 
 >   >  > 2000-01-20  Zack Weinberg  <zack@wolery.cumb.org>
 >   >  >  
 >   >  >         * Makefile.in (fixinc.sh): Depend on specs.
 >   > 
 >   > Because "specs" is part of $(STAGESTUFF), We move "specs" into the
 >   > stageN dir between stages so it gets rebuilt.  Then fixinc.sh gets
 >   > rebuilt, which triggers the stmp-fixinc target, which reruns fixinc.sh
 >   > at every stage.
 >   > 
 >   > It may correct this to remove "specs" from $(STAGESTUFF).  But I'm not
 >   > sure what side effect that would have.
 >   > 
 >   > Incidentally, this problem also causes libgcc.a to be rebuilt at every
 >   > stage due to dependencies on the header fixes.
 > I suspect the specs files are in STAGESTUFF so that we can find them in the
 > stageX directories via -BstageX/.  If we don't move them, then it's likely
 > we won't find the spec file during the stage2/stage3 build.
 > 
 > libgcc does need to get rebuilt at each stage since it can contain langauge
 > specific stuff which wouldn't have been built during stage1.
 > 
 > I'm not sure how best to address this problem.
 > 
 > jeff


	I think this patch will do the trick.  It uses the same hack
as elsewhere to build something once even though its dependencies are
rebuilt in every stage.  Worked for me on i686-pc-linux-gnu where it
returns the behavior to normal.  (I.e. fixincl only at stage1 and
libgcc.a only at stage1 and stage2, not stage3.)

Okay to install?

		--Kaveh



2000-01-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* Makefile.in (specs.ready): New target.
	(fixinc.sh): Depend on `specs.ready' instead of `specs'.

diff -rup orig/egcs-CVS20000131/gcc/Makefile.in egcs-CVS20000131/gcc/Makefile.in
--- orig/egcs-CVS20000131/gcc/Makefile.in	Sat Jan 29 18:08:53 2000
+++ egcs-CVS20000131/gcc/Makefile.in	Mon Jan 31 13:18:39 2000
@@ -2159,11 +2159,21 @@ stmp-int-hdrs: stmp-fixinc $(USER_H) xli
 stmp-headers:
 	touch $@
 
+# fixinc.sh depends on this, not on specs directly.
+# The idea is to make sure specs gets built, but not rerun fixinc.sh
+# after each stage just because specs' mtime has changed.
+specs.ready: specs
+	-if [ -f specs.ready ] ; then \
+		true; \
+	else \
+		touch specs.ready; \
+	fi
+
 FIXINCSRCDIR=$(srcdir)/fixinc
 fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \
 	$(FIXINCSRCDIR)/procopen.c $(FIXINCSRCDIR)/gnu-regex.c \
 	$(FIXINCSRCDIR)/server.c $(FIXINCSRCDIR)/gnu-regex.h \
-	$(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs
+	$(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready
 	MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc; pwd` ; \
 	export MAKE srcdir ; \
 	cd ./fixinc; $(SHELL) $${srcdir}/mkfixinc.sh $(target)


More information about the Gcc-bugs mailing list