r1431 - trunk/packages/binutils

jhuntwork at linuxfromscratch.org jhuntwork at linuxfromscratch.org
Fri Mar 3 16:06:53 PST 2006


Author: jhuntwork
Date: 2006-03-03 17:06:52 -0700 (Fri, 03 Mar 2006)
New Revision: 1431

Modified:
   trunk/packages/binutils/Makefile
Log:
Updated binutils and adjusting of toolchain to match current LFS dev

Modified: trunk/packages/binutils/Makefile
===================================================================
--- trunk/packages/binutils/Makefile	2006-03-01 14:56:07 UTC (rev 1430)
+++ trunk/packages/binutils/Makefile	2006-03-04 00:06:52 UTC (rev 1431)
@@ -54,7 +54,7 @@
 
 # fIXME: copy this file for cross-case also
 pass1: $(FILE)
-	$(sep_dir_build_noclean)
+	$(sep_dir_build)
 	cp $(SRC)/$(FILE) $(LFSSRC)
 
 compile-pass1:
@@ -63,25 +63,26 @@
 	make install
 	make -C ld clean
 	make -C ld LIB_PATH=$(WD)/lib
+	cp -v ld/ld-new /tools/bin
 
 adjust-toolchain:
-	echo 'main(){}' > dummy.c && cc dummy.c && \
-	 readelf -l a.out > .specstest
-	if ! grep -q $(WD) .specstest ; then cd $(NM)-build && \
-	 make -C ld install && \
-	 SPECFILE=`dirname $$(gcc -print-libgcc-file-name)`/specs && \
-	 gcc -dumpspecs > $$SPECFILE && \
-	 sed 's@/lib/$(LINKER)@$(WD)&@g' $$SPECFILE > tempspecfile && \
-	 mv -f tempspecfile $$SPECFILE && unset SPECFILE && \
-	 GCC_INCLUDEDIR=`dirname $$(gcc -print-libgcc-file-name)`/include && \
-	 find $${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rf '{}' \; && \
-	 rm -f `grep -l "DO NOT EDIT THIS FILE" $${GCC_INCLUDEDIR}/*` && \
-	 unset GCC_INCLUDEDIR && \
-	 cd .. && make clean ; fi
+	mv -v /tools/bin/{ld,ld-old}
+	mv -v /tools/$$(gcc -dumpmachine)/bin/{ld,ld-old}
+	mv -v /tools/bin/{ld-new,ld}
+	ln -sv /tools/bin/ld /tools/$$(gcc -dumpmachine)/bin/ld
+	SPECFILE=`dirname $$(gcc -print-libgcc-file-name)`/specs && \
+	gcc -dumpspecs > $$SPECFILE && \
+	sed 's@^/lib/ld-linux.so.2@/tools&@g' $$SPECFILE > tempspecfile && \
+	mv -vf tempspecfile $$SPECFILE && \
+	unset SPECFILE
+	GCC_INCLUDEDIR=`dirname $$(gcc -print-libgcc-file-name)`/include && \
+	find $${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; && \
+	rm -vf `grep -l "DO NOT EDIT THIS FILE" $${GCC_INCLUDEDIR}/*` && \
+	unset GCC_INCLUDEDIR
 	touch $@
 
 pass2: $(FILE) 
-	$(sep_dir_build_noclean)
+	$(sep_dir_build)
 
 compile-pass2:
 	../$(DIR)/configure --prefix=$(WD) --disable-nls \
@@ -90,21 +91,21 @@
 	make install
 	make -C ld clean
 	make -C ld LIB_PATH=/usr/lib:/lib
+	cp -v ld/ld-new /tools/bin
 
 chroot-re-adjust-toolchain:
 	chroot "$(MP)" $(chenv-pre-bash) \
 	'cd $(ROOT) && make ch-re-adjust-toolchain $(chbash-pre-bash)'
 
 re-adjust-toolchain:
-	echo 'main(){}' > dummy.c && cc dummy.c && \
-	 readelf -l a.out > .specstest
-	if grep -q $(WD) .specstest ; then cd $(NM)-build && \
-	 make -C ld INSTALL=$(WD)/bin/install install && \
-	 SPECFILE=`dirname $$(gcc -print-libgcc-file-name)`/specs && \
-	 gcc -dumpspecs > $$SPECFILE && \
-	 sed -i 's@$(WD)/lib/$(LINKER)@/lib/$(LINKER)@g' $$SPECFILE && \
-	 unset SPECFILE ; fi
-	make clean
+	mv -v /tools/bin/{ld,ld-old}
+	mv -v /tools/$$(gcc -dumpmachine)/bin/{ld,ld-old}
+	mv -v /tools/bin/{ld-new,ld}
+	ln -sv /tools/bin/ld /tools/$$(gcc -dumpmachine)/bin/ld
+	gcc -dumpspecs | \
+	perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2 at g;' \
+	    -e 's@\*startfile_prefix_spec:\n@$$_/usr/lib/ @g;' > \
+	    `dirname $$(gcc --print-libgcc-file-name)`/specs
 	touch $@
 
 chroot:




More information about the livecd mailing list