diff options
author | DJ Lucas <dj@linuxfromscratch.org> | 2017-05-13 22:56:01 +0000 |
---|---|---|
committer | DJ Lucas <dj@linuxfromscratch.org> | 2017-05-13 22:56:01 +0000 |
commit | 0967c907bcf790345d9cbb9477719117e9b78d4f (patch) | |
tree | 48d8438c9ee23f51632d35cb97f57d0fc0c4e7d3 | |
parent | 4dab0711e26adbf477cbd37bad8412f2616acd58 (diff) |
Introduce -isystem to use the final system location of gcc's internel headers in the GlibC build.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11250 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
-rw-r--r-- | chapter01/changelog.xml | 4 | ||||
-rw-r--r-- | chapter06/createfiles.xml | 2 | ||||
-rw-r--r-- | chapter06/gcc.xml | 5 | ||||
-rw-r--r-- | chapter06/glibc.xml | 41 |
4 files changed, 39 insertions, 13 deletions
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 7f03521a0..f67a442ba 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -46,6 +46,10 @@ <para>2017-05-13</para> <itemizedlist> <listitem> + <para>[dj] - Introduce -isystem to use the final system location of + gcc's internel headers in the GlibC build.</para> + </listitem> + <listitem> <para>[ken] - Update some library versions in Stripping Again, partly fixes <ulink url="&lfs-ticket-root;4085">#4085</ulink>.</para> </listitem> 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> |