diff options
author | Xi Ruoyao <xry111@mengyan1223.wang> | 2019-03-25 09:03:00 +0000 |
---|---|---|
committer | Xi Ruoyao <xry111@mengyan1223.wang> | 2019-03-25 09:03:00 +0000 |
commit | 797ada6224c18798fcaaa48d54aabe824d51ea7b (patch) | |
tree | 3ea5b88a9a42d180e73e901b5c040525cf6fa0de | |
parent | 93058448b33401726b00eb546a1359143f1c1f57 (diff) |
Use GCC option -ffile-prefix-map to simplify chapter 6 Glibc instruction
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11560 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
-rw-r--r-- | chapter01/changelog.xml | 10 | ||||
-rw-r--r-- | chapter06/glibc.xml | 28 |
2 files changed, 23 insertions, 15 deletions
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 932f94ee3..b5ab29713 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -44,6 +44,16 @@ --> <listitem> + <para>2019-03-25</para> + <itemizedlist> + <listitem> + <para>[xry111] - Use -ffile-prefix-map instead of -isystem and + symlinks in the Glibc build to simplify the instruction.</para> + </listitem> + </itemizedlist> + </listitem> + + <listitem> <para>2019-03-13</para> <itemizedlist> <listitem> diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml index 52f03219c..04a7d6f5f 100644 --- a/chapter06/glibc.xml +++ b/chapter06/glibc.xml @@ -60,31 +60,29 @@ <para>Fix a minor security issue with glob functions:</para> <screen><userinput remap="pre">patch -Np1 -i ../&glibc-glob-patch;</userinput></screen> ---> +--><!-- <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 +--> + <para>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 - i?86) GCC_INCDIR=/usr/lib/gcc/$(uname -m)-pc-linux-gnu/&gcc-version;/include - ln -sfv ld-linux.so.2 /lib/ld-lsb.so.3 + i?86) ln -sfv ld-linux.so.2 /lib/ld-lsb.so.3 ;; - x86_64) GCC_INCDIR=/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include - ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64 + x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64 ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 ;; esac</userinput></screen> - +<!-- <para>Remove a file that may be left over from a previous build attempt: </para> <screen><userinput remap="pre">rm -f /usr/include/limits.h</userinput></screen> - +--> <para>The Glibc documentation recommends building Glibc in a dedicated build directory:</para> @@ -93,22 +91,22 @@ cd build</userinput></screen> <para>Prepare Glibc for compilation:</para> -<screen><userinput remap="configure">CC="gcc -isystem $GCC_INCDIR -isystem /usr/include" \ +<screen><userinput remap="configure">CC="gcc -ffile-prefix-map=/tools=/usr" \ ../configure --prefix=/usr \ --disable-werror \ --enable-kernel=&min-kernel; \ --enable-stack-protector=strong \ - libc_cv_slibdir=/lib -unset GCC_INCDIR</userinput></screen> + libc_cv_slibdir=/lib</userinput></screen> <variablelist> <title>The meaning of the options and new configure parameters:</title> <varlistentry> - <term><parameter>CC="gcc -isystem $GCC_INCDIR -isystem /usr/include"</parameter></term> + <term><parameter>CC="gcc -ffile-prefix-map=/tools=/usr"</parameter></term> <listitem> - <para>Setting the location of both gcc and system include directories - avoids introduction of invalid paths in debugging symbols.</para> + <para>Make GCC record any references to files in /tools in result + of the compilation as if the files resided in /usr. This avoids + introduction of invalid paths in debugging symbols.</para> </listitem> </varlistentry> |