From ae581daa002f6651c564c2cfccb159ccdb6686e0 Mon Sep 17 00:00:00 2001 From: Alex Gronenwoud Date: Thu, 28 Aug 2003 21:19:09 +0000 Subject: [PATCH] Updating chapter 6 Binutils and Gcc installation text. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2690 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/binutils-inst.xml | 27 ++++++++++++++++----------- chapter06/gcc-inst.xml | 33 +++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/chapter06/binutils-inst.xml b/chapter06/binutils-inst.xml index d080a7a5d..1d2aafd16 100644 --- a/chapter06/binutils-inst.xml +++ b/chapter06/binutils-inst.xml @@ -6,7 +6,7 @@ default optimization flags (including the -march and -mcpu options). Therefore, if you have defined any environment variables that override default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting -or modifying them when building binutils. +or modifying them when building Binutils. It is recommended by the Binutils installation documentation to build Binutils outside of the source directory: @@ -14,29 +14,34 @@ Binutils outside of the source directory: mkdir ../binutils-build cd ../binutils-build -Next, prepare Binutils to be compiled: +Now prepare Binutils for compilation: ../binutils-&binutils-version;/configure \     --prefix=/usr --enable-shared -Continue with compiling the package: +Compile the package: make tooldir=/usr -make check - Normally, the tooldir (the directory where the -executables end up) is set to $(exec_prefix)/$(target_alias) which expands -into, for example, /usr/i686-pc-linux-gnu. Since we only build for our -own system, we don't need this target specific directory in /usr. That -setup would be used if the system was used to cross-compile (for example -compiling a package on the Intel machine that generates code that can be -executed on Apple PowerPC machines). +executables end up) is set to $(exec_prefix)/$(target_alias), which expands +into, for example, /usr/i686-pc-linux-gnu. Since we only +build for our own system, we don't need this target specific directory in +/usr. That setup would be used if the system was used to +cross-compile (for example compiling a package on an Intel machine that +generates code that can be executed on PowerPC machines). + +Check the results: + +make check Install the package: make tooldir=/usr install +And remove a library that normally is not meant to be installed on its +own: + rm /usr/lib/libiberty.a diff --git a/chapter06/gcc-inst.xml b/chapter06/gcc-inst.xml index a8fa65fdd..7d242663e 100644 --- a/chapter06/gcc-inst.xml +++ b/chapter06/gcc-inst.xml @@ -9,29 +9,30 @@ Therefore, if you have defined any environment variables that override default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting or modifying them when building GCC. -We will be building the C and C++ compilers at this time, so you'll -need to unpack both the gcc-core and gcc-g++ tarballs. Other compilers are -available in the full gcc package; instructions for building them may be -found at . +This time we will build both the C and the C++ compiler, so you'll have +to unpack the GCC-core and the GCC-g++ tarball -- they +will unfold into the same directory. The full GCC package contains even more +compilers. Instructions for building these can be found at +. patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes.patch patch -Np1 -i ../gcc-&gcc-version;-mmap_test.patch -It is recommended by the GCC installation documentation to build GCC -in a dedicated directory outside of the source tree. Create the build -directory: +GCC's installation documentation recommends to build the package in a +dedicated directory separate from the source tree. Create this build +directory and go there: mkdir ../gcc-build cd ../gcc-build -Prepare GCC to be compiled: +Now prepare GCC for compilation: ../gcc-&gcc-version;/configure --prefix=/usr \     --enable-shared --enable-threads=posix \     --enable-__cxa_atexit --enable-clocale=gnu \     --enable-languages=c,c++ -The meanings of the configure options are: +The meaning of the new configure options: --enable-threads=posix: This enables @@ -50,13 +51,16 @@ this specific locale, then the correct locale mode (gnu) is implemented. -Continue with compiling the package: +Compile the package: make +Check the results, but don't stop at errors (you'll remember the few +known ones): + make -k check -Finish installing the package: +And install the package: make install @@ -66,12 +70,13 @@ To honor those packages, create two symlinks: ln -s ../usr/bin/cpp /lib -Many packages compile using cc as the name for -the C compiler. To satisfy those packages, create a cc -symlink: +Many packages use the name cc to call the C +compiler. To satisfy those packages, create a symlink: ln -s gcc /usr/bin/cc +Remove the spurious a-out library again: + rm /usr/lib/libiberty.a