diff options
Diffstat (limited to 'chapter06')
-rw-r--r-- | chapter06/createfiles.xml | 2 | ||||
-rw-r--r-- | chapter06/gcc.xml | 5 | ||||
-rw-r--r-- | chapter06/glibc.xml | 41 |
3 files changed, 35 insertions, 13 deletions
diff --git a/chapter06/createfiles.xml b/chapter06/createfiles.xml index 99cc0da9f..1dabbbbfd 100644 --- a/chapter06/createfiles.xml +++ b/chapter06/createfiles.xml @@ -169,7 +169,7 @@ ln -sv bash /bin/sh</userinput></screen> <varlistentry revision="systemd"> <term><parameter><filename>/usr/lib/lib{blkid,lzma,mount,uuid}.{a,la,so*}</filename></parameter></term> <listitem> - <para>These links prevent systemd utilties from being poluted with an + <para>These links prevent systemd utilities from being acquiring an unnecessary reference to the <filename class="directory">/tools</filename> directory.</para> </listitem> diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml index 47f96f720..b8fa2a327 100644 --- a/chapter06/gcc.xml +++ b/chapter06/gcc.xml @@ -51,6 +51,11 @@ ;; esac</userinput></screen> + <para>Remove the symlink created earlier as the final gcc includes will be + installed here:</para> + +<screen><userinput remap="pre">rm -f /usr/lib/gcc</userinput></screen> + <para>The GCC documentation recommends building GCC in a dedicated build directory:</para> <screen><userinput remap="pre">mkdir -v build diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml index 5d2afcd81..d43853431 100644 --- a/chapter06/glibc.xml +++ b/chapter06/glibc.xml @@ -57,14 +57,21 @@ <screen><userinput remap="pre">patch -Np1 -i ../&glibc-fhs-patch;</userinput></screen> - <para>Create a symlink for LSB compliance and, for x86_64, a - compatibility symlink required for the dynamic loader to function - correctly:</para> + <para>First create a compatibility symlink to avoid references to /tools in + our final glibc:</para> + +<screen><userinput remap="pre">ln -sfv /tools/lib/gcc /usr/lib</userinput></screen> + + <para>Determine the GCC include directory and create a symlink for LSB + compliance. Additionally, for x86_64, create a compatibility symlink + required for the dynamic loader to function correctly:</para> <screen><userinput remap="pre">case $(uname -m) in - x86) ln -s ld-linux.so.2 /lib/ld-lsb.so.3 + x86) GCC_INCDIR=/usr/lib/gcc/x86-pc-linux-gnu/&gcc-version;/include + ln -s ld-linux.so.2 /lib/ld-lsb.so.3 ;; - x86_64) ln -s ../lib/ld-linux-x86-64.so.2 /lib64 + x86_64) GCC_INCDIR=/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include + ln -s ../lib/ld-linux-x86-64.so.2 /lib64 ln -s ../lib/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 ;; esac</userinput></screen> @@ -77,15 +84,25 @@ cd build</userinput></screen> <para>Prepare Glibc for compilation:</para> -<screen><userinput remap="configure">../configure --prefix=/usr \ - --disable-werror \ - --enable-kernel=&min-kernel; \ - --enable-obsolete-rpc \ - --enable-stack-protector=strong \ - libc_cv_slibdir=/lib</userinput></screen> +<screen><userinput remap="configure">CC="gcc -isystem $GCC_INCDIR -isystem /usr/include" \ +../configure --prefix=/usr \ + --disable-werror \ + --enable-kernel=&min-kernel; \ + --enable-obsolete-rpc \ + --enable-stack-protector=strong \ + libc_cv_slibdir=/lib +unset GCC_INCDIR</userinput></screen> <variablelist> - <title>The meaning of the new configure options:</title> + <title>The meaning of the options and new configure parameters:</title> + + <varlistentry> + <term><parameter>CC="gcc -isystem $GCC_INCDIR -isystem /usr/include"</parameter></term> + <listitem> + <para>Setting the location of both gcc and system include directories + avoids introduction of invalid paths in debuging symbols.</para> + </listitem> + </varlistentry> <varlistentry> <term><parameter>--disable-werror</parameter></term> |