From 503e1a60b8edce2dc0c2e0f7db9ad9c4f22c39a6 Mon Sep 17 00:00:00 2001 From: Alex Gronenwoud Date: Mon, 18 Aug 2003 20:54:11 +0000 Subject: [PATCH] moved adjusting toolchain, bug #519, bug #537, and updated changelog git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2673 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter01/changelog.xml | 10 ++++++ chapter05/chapter05.xml | 54 +++++++++++++++++++++++++++++++++ chapter05/creatingstage1dir.xml | 4 +-- chapter05/ncurses-inst.xml | 4 --- chapter06/chapter06.xml | 1 - index.xml | 4 +-- 6 files changed, 68 insertions(+), 9 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 27cbb1735..d31576932 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -82,6 +82,16 @@ +August 17th, 2003 [alex]: Moved the adjusting of the toolchain +from chapter 6 to the end of chapter 5. + +August 17th, 2003 [alex]: Chapter 05 - From Bash to Perl: +put text in between commands. Added a section on stripping unneeded +symbols to decrease the size of the tools. + +August 16th, 2003 [alex]: Chapter 05 - From Make to Texinfo: +put text in between commands. + August 11th, 2003 [alex]: Chapter 05 - From Binutils Pass 1 to Findutils: several small textual adjustments. For the second passes not giving the contents and dependencies. diff --git a/chapter05/chapter05.xml b/chapter05/chapter05.xml index 922b125f0..f21f931e8 100644 --- a/chapter05/chapter05.xml +++ b/chapter05/chapter05.xml @@ -35,6 +35,60 @@ &c5-utillinux; &c5-perl; + + +Re-adjusting the toolchain + + +Now that we have compiled all the necessary tools, it is time to +re-adjust our toolchain. We will set it up so that it will link any newly +compiled program against the new Glibc, which is the first thing to get +compiled in the next chapter. Basically, this is the reverse of what we did +in the "Locking in" stage in the beginning of this chapter. + +The first thing to do is to adjust the linker scripts. For this we +retained the binutils-build directory from the second +pass over Binutils. Do the following: + +cd binutils-build +make -C ld INSTALL=/stage1/bin/install install-data-local + +This installs the adjusted linker scripts. The linker scripts now contain +no mention of /stage1/lib. From now on every compiled +program will link only against the libraries in +/usr/lib and /lib. The extra +INSTALL=/stage1/bin/install is needed because the +Makefile created during the second pass still contains the reference to +/usr/bin/install, which we obviously haven't installed +yet. + +You can now remove the Binutils source and build directories. + +The next thing to do is to amend our GCC specs file so that it points to +the new dynamic linker. Just like earlier on, we use a sed to accomplish +this: + +CURRENTSPECFILE=/stage1/lib/gcc-lib/*/*/specs +sed -e 's@/stage1/lib/ld.so.1@/lib/ld.so.1@g' \ +    -e 's@/stage1/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \ +    $CURRENTSPECFILE > newspecfile +mv newspecfile $CURRENTSPECFILE +unset CURRENTSPECFILE + +Again, cutting and pasting the above is recommended. And just like +before, it is a good idea to check the linker scripts and the specs file to +ensure the intended changes were actually made. + +Note that the linker scripts will still contain a reference to +/stage1/i686-pc-linux-gnu/lib. This is unavoidable, but +luckily does not present a problem. There are no libraries in that location +as all the temporary stage1 libraries are located in +/stage1/lib. + + + + + Stripping diff --git a/chapter05/creatingstage1dir.xml b/chapter05/creatingstage1dir.xml index 7e4b733a9..4ff58628c 100644 --- a/chapter05/creatingstage1dir.xml +++ b/chapter05/creatingstage1dir.xml @@ -19,8 +19,8 @@ partition: This symlink enables us to compile our toolchain so that it always refers to /stage1, meaning that the compiler, assembler -and linker will work both in this chapter (when we are still rummaging around -on the host) and in the next (when we are chrooted to +and linker will work both in this chapter (when we are still using some tools +from the host) and in the next (when we are chrooted to the LFS partition). diff --git a/chapter05/ncurses-inst.xml b/chapter05/ncurses-inst.xml index d7bcb1a66..e5a926e17 100644 --- a/chapter05/ncurses-inst.xml +++ b/chapter05/ncurses-inst.xml @@ -25,9 +25,5 @@ deprecated headers. make install -And make some of the libraries executable: - -chmod 755 /stage1/lib/*.5.3 - diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml index d3843cbb2..8c7683a94 100644 --- a/chapter06/chapter06.xml +++ b/chapter06/chapter06.xml @@ -14,7 +14,6 @@ &c6-kernel; &c6-manpages; &c6-glibc; -&c6-adjustingtoolchain; &c6-binutils; &c6-gcc; &c6-coreutils; diff --git a/index.xml b/index.xml index 41c2a986c..28baa74d2 100644 --- a/index.xml +++ b/index.xml @@ -4,8 +4,8 @@ - - + +