make unstage vs combined tree

Richard Henderson rth@redhat.com
Fri Oct 26 00:30:00 GMT 2001


When building a combined gcc+binutils tree, we create symlinks
from the gcc directory to the new as and ld binaries.  The 
make stageN targets create links from the stage directory back
to the main build directory.

However, the unstageN targets would copy the stageN link on 
top of the main build link, which results in a dangling link,
which means that the gcc driver continues along its search
path, and suddenly you aren't using the assembler you thought
you were using.  Which can be extremely confusing to debug.


r~

        * Makefile.in (unstage*): Remove as, ld, collect-ld before
        moving everything back to the main build directory.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.757
diff -c -p -d -r1.757 Makefile.in
*** Makefile.in	2001/10/21 16:29:12	1.757
--- Makefile.in	2001/10/26 07:11:53
*************** bootstrap4 bootstrap4-lean: stage4_build
*** 3048,3053 ****
--- 3048,3056 ----
  
  unstage1 unstage2 unstage3 unstage4:
  	-set -vx; stage=`echo $@ | sed -e 's/un//'`; \
+ 	rm -f $$stage/as$(exeext); \
+ 	rm -f $$stage/ld$(exeext); \
+ 	rm -f $$stage/collect-ld$(exeext); \
  	if test -d $$stage; then \
  	  mv $$stage/* . 2>/dev/null; \
  	  for i in `cd $$stage; echo *` ; do \



More information about the Gcc-patches mailing list