diff --git a/chapter05/adjusting.xml b/chapter05/adjusting.xml
index b97669497..b48a17128 100644
--- a/chapter05/adjusting.xml
+++ b/chapter05/adjusting.xml
@@ -1,78 +1,82 @@
-
%general-entities;
]>
+
-Adjusting the Toolchain
-
+
-Now that the temporary C libraries have been installed, all
-tools compiled in the rest of this chapter should be linked against
-these libraries. In order to accomplish this, the linker and the
-compiler's specs file need to be adjusted.
+ Adjusting the Toolchain
-The linker, adjusted at the end of the first pass of Binutils,
-is installed by running the following command from within the
-binutils-build directory:
+ Now that the temporary C libraries have been installed, all
+ tools compiled in the rest of this chapter should be linked against
+ these libraries. In order to accomplish this, the linker and the
+ compiler's specs file need to be adjusted.
+
+ The linker, adjusted at the end of the first pass of Binutils,
+ is installed by running the following command from within the
+ binutils-build directory:
make -C ld install
-From this point onwards, everything will link only
-against the libraries in /tools/lib.
+ From this point onwards, everything will link only against the
+ libraries in /tools/lib.
-If the earlier warning to retain the Binutils source and
-build directories from the first pass was missed, ignore the above
-command. This results in a small chance that the subsequent testing
-programs will link against libraries on the host. This is not ideal,
-but it is not a major problem. The situation is corrected when the
-second pass of Binutils is installed later.
+
+ If the earlier warning to retain the Binutils source and
+ build directories from the first pass was missed, ignore the above
+ command. This results in a small chance that the subsequent testing
+ programs will link against libraries on the host. This is not ideal,
+ but it is not a major problem. The situation is corrected when the
+ second pass of Binutils is installed later.
+
-Now that the adjusted linker is installed, the Binutils build and source
-directories should be removed.
+ Now that the adjusted linker is installed, the Binutils build and source
+ directories should be removed.
-The next task is to point GCC to the new dynamic linker. This is done by
-dumping GCC's specs
file to a location where GCC will look for it
-by default. A simple sed substitution then alters the
-dynamic linker that GCC will use:
+ The next task is to point GCC to the new dynamic linker. This is done by
+ dumping GCC's specs
file to a location where GCC will look for it
+ by default. A simple sed substitution then alters the
+ dynamic linker that GCC will use:
-
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
-It is recommended that the above
-command be copy-and-pasted in order to ensure accuracy.
-Alternatively, the specs file can be edited by hand. This is done by
-replacing every occurrence of /lib/ld-linux.so.2
with
-/tools/lib/ld-linux.so.2
+ It is recommended that the above command be copy-and-pasted in order to
+ ensure accuracy. Alternatively, the specs file can be edited by hand. This is
+ done by replacing every occurrence of /lib/ld-linux.so.2
with
+ /tools/lib/ld-linux.so.2
-Be sure to visually inspect the specs file in order to verify the
-intended changes have been made.
+ Be sure to visually inspect the specs file in order to verify the
+ intended changes have been made.
-If working on a platform where the name of the
-dynamic linker is something other than
-ld-linux.so.2, replace
-ld-linux.so.2
with the name of the platform's
-dynamic linker in the above commands. Refer back to if
-necessary.
+
+ If working on a platform where the name of the dynamic linker is
+ something other than ld-linux.so.2,
+ replace ld-linux.so.2
with the name of the platform's
+ dynamic linker in the above commands. Refer back to if necessary.
+
-During the build process, GCC runs a script
-(fixincludes) that scans the system for header files that may
-need to be fixed (they might contain syntax errors, for example), and installs
-the fixed versions in a private include directory. There is a possibility that,
-as a result of this process, some header files from the host system have found
-their way into GCC's private include directory. As the rest of this chapter only
-requires the headers from GCC and Glibc, which have both been installed at this
-point, any "fixed" headers can safely be removed. This helps to avoid
-any host headers polluting the build environment. Run the following commands to
-remove the header files in GCC's private include directory (you may find it
-easier to copy and paste these commands, rather than typing them by hand, due to
-their length):
+ During the build process, GCC runs a script
+ (fixincludes) that scans the system for header files
+ that may need to be fixed (they might contain syntax errors, for example),
+ and installs the fixed versions in a private include directory. There is a
+ possibility that, as a result of this process, some header files from the
+ host system have found their way into GCC's private include directory. As
+ the rest of this chapter only requires the headers from GCC and Glibc,
+ which have both been installed at this point, any fixed
+ headers can safely be removed. This helps to avoid any host headers
+ polluting the build environment. Run the following commands to remove the
+ header files in GCC's private include directory (you may find it easier to
+ copy and paste these commands, rather than typing them by hand, due to
+ their length):
GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include &&
@@ -80,50 +84,49 @@ find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; &&
rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` &&
unset GCC_INCLUDEDIR
-At this point, it is imperative to stop and ensure that
-the basic functions (compiling and linking) of the new toolchain are
-working as expected. To perform a sanity check, run the following
-commands:
+
+ At this point, it is imperative to stop and ensure that the basic
+ functions (compiling and linking) of the new toolchain are working as
+ expected. To perform a sanity check, run the following commands:
echo 'main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'
-If everything is working correctly, there should be no errors,
-and the output of the last command will be of the form:
+ If everything is working correctly, there should be no errors,
+ and the output of the last command will be of the form:
-[Requesting program interpreter:
+[Requesting program interpreter:
/tools/lib/ld-linux.so.2]
-Note that /tools/lib
-appears as the prefix of the dynamic linker.
+ Note that /tools/lib
+ appears as the prefix of the dynamic linker.
-If the output is not shown as above or there was no output at
-all, then something is wrong. Investigate and retrace the steps to
-find out where the problem is and correct it. This issue must be
-resolved before continuing on. First, perform the sanity check again,
-using gcc instead of cc. If this
-works, then the /tools/bin/cc symlink is missing.
-Revisit and install the symlink.
-Next, ensure that the PATH is correct. This can be checked by running
-echo $PATH and verifying that /tools/bin is at the head of the list. If
-the PATH is wrong it could mean that you are not logged in as user
-lfs or that something went wrong back in Another option is that something
-may have gone wrong with the specs file amendment above. In this case,
-redo the specs file amendment, being careful to copy-and-paste the
-commands.
+ If the output is not shown as above or there was no output at all,
+ then something is wrong. Investigate and retrace the steps to find out
+ where the problem is and correct it. This issue must be resolved before
+ continuing on. First, perform the sanity check again, using
+ gcc instead of cc. If this works,
+ then the /tools/bin/cc symlink is
+ missing. Revisit and install
+ the symlink. Next, ensure that the PATH is correct. This
+ can be checked by running echo $PATH and verifying that
+ /tools/bin is at the head of the
+ list. If the PATH is wrong it could mean that you are not
+ logged in as user lfs or that
+ something went wrong back in Another option is that something may have gone wrong with the
+ specs file amendment above. In this case, redo the specs file amendment,
+ being careful to copy-and-paste the commands.
-Once all is well, clean up the test files:
+ Once all is well, clean up the test files:
rm -v dummy.c a.out
-Building TCL in the next section will serve as an additional check that
-the toolchain has been built properly. If TCL fails to build, it is an
-indication that something has gone wrong with the Binutils, GCC, or Glibc
-installation, but not with TCL itself.
-
-
+ Building TCL in the next section will serve as an additional check that
+ the toolchain has been built properly. If TCL fails to build, it is an
+ indication that something has gone wrong with the Binutils, GCC, or Glibc
+ installation, but not with TCL itself.
+
diff --git a/chapter05/bash.xml b/chapter05/bash.xml
index c8b72eae0..e71640991 100644
--- a/chapter05/bash.xml
+++ b/chapter05/bash.xml
@@ -1,69 +1,90 @@
-
%general-entities;
]>
+
-Bash-&bash-version;
-
+
-
-Bash
-tools
+ Bash-&bash-version;
-
-
+
+ Bash
+ tools
+
-
-&buildtime;
-&diskspace;
-1.2 SBU20.7 MB
-
+
+
-
+
-
+
+ &buildtime;
+ &diskspace;
-
-Installation of Bash
+
+ 1.2 SBU
+ 20.7 MB
+
+
-
-Prepare Bash for compilation:
+
+
+
+
+
+ Installation of Bash
+
+ Prepare Bash for compilation:
./configure --prefix=/tools --without-bash-malloc
-The meaning of the configure options:
+
+ The meaning of the configure options:
-
-
---without-bash-malloc
-This options turns off the use of Bash's memory
-allocation (malloc) function which is known to cause segmentation
-faults. By turning this option off, Bash will use the malloc functions
-from Glibc which are more stable.
-
-
+
+ --without-bash-malloc
+
+ This options turns off the use of Bash's memory allocation
+ (malloc) function which is known to cause
+ segmentation faults. By turning this option off, Bash will use
+ the malloc functions from Glibc which are
+ more stable.
+
+
-Compile the package:
+
+
+ Compile the package:
make
-To test the results, issue: make tests.
+ To test the results, issue:
+ make tests.
-Install the package:
+ Install the package:
make install
-Make a link for the programs that use sh for
-a shell:
+ Make a link for the programs that use sh for
+ a shell:
ln -vs bash /tools/bin/sh
-
+
-
-Details on this package are located in
-
+
+
+
+ Details on this package are located in
+
+
+
-
diff --git a/chapter05/binutils-pass1.xml b/chapter05/binutils-pass1.xml
index 5ce27d0b6..4435cfca0 100644
--- a/chapter05/binutils-pass1.xml
+++ b/chapter05/binutils-pass1.xml
@@ -1,122 +1,153 @@
-
%general-entities;
]>
+
-Binutils-&binutils-version; - Pass 1
-
+
-
-Binutils
-tools, pass 1
+ Binutils-&binutils-version; - Pass 1
-
-
+
+ Binutils
+ tools, pass 1
+
-
-&buildtime;
-&diskspace;
-1.0 SBU170 MB
-
+
+
-
+
-
+
+ &buildtime;
+ &diskspace;
-
-Installation of Binutils
+
+ 1.0 SBU
+ 170 MB
+
+
-It is important that Binutils be the first package compiled
-because both Glibc and GCC perform various tests on the available
-linker and assembler to determine which of their own features to
-enable.
+
-The Binutils documentation recommends building Binutils outside of the
-source directory in a dedicated build directory:
+
+
+
+ Installation of Binutils
+
+ It is important that Binutils be the first package compiled
+ because both Glibc and GCC perform various tests on the available
+ linker and assembler to determine which of their own features to
+ enable.
+
+ The Binutils documentation recommends building Binutils outside of the
+ source directory in a dedicated build directory:
mkdir -v ../binutils-build
cd ../binutils-build
-In order for the SBU values listed in the rest of the book
-to be of any use, measure the time it takes to build this package from
-the configuration, up to and including the first install. To achieve
-this easily, wrap the three commands in a time
-command like this: time { ./configure ... && make
-&& make install; }.
+
+ In order for the SBU values listed in the rest of the book
+ to be of any use, measure the time it takes to build this package from
+ the configuration, up to and including the first install. To achieve
+ this easily, wrap the three commands in a time
+ command like this: time { ./configure ... && make
+ && make install; }.
+
-Now prepare Binutils for compilation:
+ Now prepare Binutils for compilation:
../binutils-&binutils-version;/configure --prefix=/tools --disable-nls
-The meaning of the configure options:
+
+ The meaning of the configure options:
-
-
---prefix=/tools
-This tells the configure script to prepare to install the Binutils
-programs in the /tools directory.
-
+
+ --prefix=/tools
+
+ This tells the configure script to prepare to install the
+ Binutils programs in the /tools
+ directory.
+
+
-
---disable-nls
-This disables internationalization as i18n is not needed for the
-temporary tools.
-
-
+
+ --disable-nls
+
+ This disables internationalization as i18n is not needed for the
+ temporary tools.
+
+
-Continue with compiling the package:
+
+
+ Continue with compiling the package:
make
-Compilation is now complete. Ordinarily we would now run the
-test suite, but at this early stage the test suite framework (Tcl,
-Expect, and DejaGNU) is not yet in place. The benefits of running the
-tests at this point are minimal since the programs from this
-first pass will soon be replaced by those from the second.
+ Compilation is now complete. Ordinarily we would now run the
+ test suite, but at this early stage the test suite framework (Tcl,
+ Expect, and DejaGNU) is not yet in place. The benefits of running the
+ tests at this point are minimal since the programs from this
+ first pass will soon be replaced by those from the second.
-Install the package:
+ Install the package:
make install
-Next, prepare the linker for the Adjusting
phase
-later on:
+ Next, prepare the linker for the Adjusting
phase
+ later on:
make -C ld clean
make -C ld LIB_PATH=/tools/lib
-The meaning of the make parameters:
+
+ The meaning of the make parameters:
-
-
--C ld clean
-This tells the make program to remove all compiled
-files in the ld
-subdirectory.
-
+
+ -C ld clean
+
+ This tells the make program to remove all compiled
+ files in the ld
+ subdirectory.
+
+
-
--C ld LIB_PATH=/tools/lib
-This option rebuilds everything in the
-ld subdirectory. Specifying
-the LIB_PATH Makefile variable on the command
-line allows us to override the default value
-and point it to the temporary tools location. The value of this variable
-specifies the linker's default library search path. This preparation
-is used later in the chapter.
-
-
+
+ -C ld LIB_PATH=/tools/lib
+
+ This option rebuilds everything in the ld subdirectory. Specifying the
+ LIB_PATH Makefile variable on the command line
+ allows us to override the default value and point it to the
+ temporary tools location. The value of this variable specifies
+ the linker's default library search path. This preparation is
+ used later in the chapter.
+
+
-Do not remove the Binutils
-build and source directories yet. These will be needed again in their
-current state later in this chapter.
+
-
+
+ Do not remove the Binutils build and source
+ directories yet. These will be needed again in their current state later
+ in this chapter.
+
-
-Details on this package are located in
-
+
+
+
+
+
+ Details on this package are located in
+
+
+
-
diff --git a/chapter05/binutils-pass2.xml b/chapter05/binutils-pass2.xml
index 2f8a8c68b..8a7cc53ff 100644
--- a/chapter05/binutils-pass2.xml
+++ b/chapter05/binutils-pass2.xml
@@ -1,91 +1,107 @@
-
%general-entities;
]>
+
-Binutils-&binutils-version; - Pass 2
-
+
-
-Binutils
-tools, pass 2
+ Binutils-&binutils-version; - Pass 2
-
-
+
+ Binutils
+ tools, pass 2
+
-
-&buildtime;
-&diskspace;
-1.5 SBU114 MB
-
+
+
-
+
-
+
+ &buildtime;
+ &diskspace;
-
-Re-installation of Binutils
+
+ 1.5 SBU
+ 114 MB
+
+
-Create a separate build directory again:
+
+
+
+
+
+ Re-installation of Binutils
+
+ Create a separate build directory again:
mkdir -v ../binutils-build
cd ../binutils-build
-Prepare Binutils for compilation:
+ Prepare Binutils for compilation:
../binutils-&binutils-version;/configure --prefix=/tools \
--disable-nls --enable-shared --with-lib-path=/tools/lib
-The meaning of the new configure options:
+
+ The meaning of the new configure options:
-
-
---with-lib-path=/tools/lib
-This tells the configure script to specify the library
-search path during the compilation of Binutils, resulting in /tools/lib being passed to the linker.
-This prevents the linker from searching through library directories on
-the host.
-
-
+
+ --with-lib-path=/tools/lib
+
+ This tells the configure script to specify the library
+ search path during the compilation of Binutils, resulting in
+ /tools/lib being passed
+ to the linker. This prevents the linker from searching through
+ library directories on the host.
+
+
-Compile the package:
+
+
+ Compile the package:
make
-Compilation is now complete. As discussed earlier, running the
-test suite is not mandatory for the temporary tools here in this
-chapter. To run the Binutils test suite anyway, issue the following
-command:
+ Compilation is now complete. As discussed earlier, running the
+ test suite is not mandatory for the temporary tools here in this
+ chapter. To run the Binutils test suite anyway, issue the following
+ command:
make check
-Install the package:
+ Install the package:
make install
-Now prepare the linker for the Re-adjusting
phase in the next
-chapter:
+ Now prepare the linker for the Re-adjusting
phase in
+ the next chapter:
make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib
+
+ Do not remove the Binutils source and build
+ directories yet. These directories will be needed again in the next
+ chapter in their current state.
+
-Do not remove the Binutils source and
-build directories yet. These directories will be needed again in the next
-chapter in their current state.
+
-
+
+
-
-Details on this package are located in
-
+ Details on this package are located in
+
+
+
-
diff --git a/chapter05/bison.xml b/chapter05/bison.xml
index eee7633fe..c2222c6c1 100644
--- a/chapter05/bison.xml
+++ b/chapter05/bison.xml
@@ -1,53 +1,69 @@
-
%general-entities;
]>
-
-Bison-&bison-version;
-
-
-Bison
-tools
+
+
-
-
+ Bison-&bison-version;
-
-&buildtime;
-&diskspace;
-0.6 SBU10.0 MB
-
+
+ Bison
+ tools
+
-
+
+
-
+
-
-Installation of Bison
+
+ &buildtime;
+ &diskspace;
-Prepare Bison for compilation:
+
+ 0.6 SBU
+ 10.0 MB
+
+
+
+
+
+
+
+
+ Installation of Bison
+
+ Prepare Bison for compilation:
./configure --prefix=/tools
-Compile the package:
+ Compile the package:
make
-To test the results, issue: make
-check.
+ To test the results, issue:
+ make check.
-Install the package:
+ Install the package:
make install
-
+
-
-Details on this package are located in
-
+
+
+
+ Details on this package are located in
+
+
+
-
diff --git a/chapter05/bzip2.xml b/chapter05/bzip2.xml
index 0592d1de0..b4f1aefea 100644
--- a/chapter05/bzip2.xml
+++ b/chapter05/bzip2.xml
@@ -1,47 +1,63 @@
-
%general-entities;
]>
+
-Bzip2-&bzip2-version;
-
+
-
-Bzip2
-tools
+ Bzip2-&bzip2-version;
-
-
+
+ Bzip2
+ tools
+
-
-&buildtime;
-&diskspace;
-0.1 SBU3.5 MB
-
+
+
-
+
-
+
+ &buildtime;
+ &diskspace;
-
-Installation of Bzip2
+
+ 0.1 SBU
+ 3.5 MB
+
+
-The Bzip2 package does not contain a configure
-script. Compile and test it with:
+
+
+
+
+
+ Installation of Bzip2
+
+ The Bzip2 package does not contain a configure
+ script. Compile and test it with:
make
-Install the package:
+ Install the package:
make PREFIX=/tools install
-
+
-
-Details on this package are located in
-
+
+
+
+ Details on this package are located in
+
+
+
-
diff --git a/chapter05/chapter05.xml b/chapter05/chapter05.xml
index 8b3eedfd8..45d2081b4 100644
--- a/chapter05/chapter05.xml
+++ b/chapter05/chapter05.xml
@@ -1,45 +1,48 @@
-
%general-entities;
]>
-
-
-Constructing a Temporary System
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ Constructing a Temporary System
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/general.ent b/general.ent
index 06c116463..3b98acc74 100644
--- a/general.ent
+++ b/general.ent
@@ -1,6 +1,6 @@
-
-
+
+