This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

``install'' $(SPECS) in stage directory


If SPECS is defined to a file with a different name, a staged compiler
in a bootstrap won't be able to find specs in the stage directory.  It
may end up using a previously-installed specs file from the install
tree, which is undesirable.  This patch arranges for us to ``install''
the $(SPECS) file in the stage directory, since that's the spec file
that the compiler is supposed to use.  Tested on mips64-linux-gnu and
mips64el-linux-gnu.

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva at redhat dot com>
	* Makefile.in (stage1-start, stage2-start, stage3-start,
	stage4-start): Move $(SPECS) to specs in stage dir.
	(unstage1 unstage2 unstage3 unstage4): Move specs in stage dir
	back as $(SPECS).

2003-04-12  Alexandre Oliva  <aoliva at redhat dot com>

Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1032
diff -u -p -r1.1032 Makefile.in
--- gcc/Makefile.in 12 Apr 2003 01:58:32 -0000 1.1032
+++ gcc/Makefile.in 12 Apr 2003 08:57:29 -0000
@@ -3545,6 +3545,7 @@ unstage1 unstage2 unstage3 unstage4:
 	rm -f $$stage/ld$(exeext); \
 	rm -f $$stage/collect-ld$(exeext); \
 	if test -d $$stage; then \
+	  mv $$stage/specs $(SPECS) 2>/dev/null || :; \
 	  mv $$stage/* . 2>/dev/null; \
 	  for i in `cd $$stage; echo *` ; do \
 	    if test -d $$stage/$$i; then \
@@ -3678,6 +3679,8 @@ stage1-start:
 	 do \
 	   if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
 	 done
+# If SPECS is overridden, make sure it is `installed' as specs.
+	-mv $(SPECS) stage1/specs
 	-mv $(STAGESTUFF) stage1
 	-mv intl/*$(objext) stage1/intl
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
@@ -3710,6 +3713,8 @@ stage2-start:
 	 do \
 	   if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
 	 done
+# If SPECS is overridden, make sure it is `installed' as specs.
+	-mv $(SPECS) stage2/specs
 	-mv $(STAGESTUFF) stage2
 	-mv intl/*$(objext) stage2/intl
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
@@ -3738,6 +3743,8 @@ stage3-start:
 	 do \
 	   if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
 	 done
+# If SPECS is overridden, make sure it is `installed' as specs.
+	-mv $(SPECS) stage3/specs
 	-mv $(STAGESTUFF) stage3
 	-mv intl/*$(objext) stage3/intl
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
@@ -3766,6 +3773,8 @@ stage4-start:
 	 do \
 	   if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
 	 done
+# If SPECS is overridden, make sure it is `installed' as specs.
+	-mv $(SPECS) stage4/specs
 	-mv $(STAGESTUFF) stage4
 	-mv intl/*$(objext) stage4/intl
 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]