Changeset 797ada6


Ignore:
Timestamp:
03/25/2019 09:03:00 AM (5 years ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
0e800df
Parents:
93058448
Message:

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

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chapter01/changelog.xml

    r93058448 r797ada6  
    4343    appropriate for the entry or if needed the entire day's listitem.
    4444    -->
     45
     46    <listitem>
     47      <para>2019-03-25</para>
     48      <itemizedlist>
     49        <listitem>
     50          <para>[xry111] - Use -ffile-prefix-map instead of -isystem and
     51          symlinks in the Glibc build to simplify the instruction.</para>
     52        </listitem>
     53      </itemizedlist>
     54    </listitem>
    4555
    4656    <listitem>
  • chapter06/glibc.xml

    r93058448 r797ada6  
    6161
    6262<screen><userinput remap="pre">patch -Np1 -i ../&glibc-glob-patch;</userinput></screen>
    63 -->
     63--><!--
    6464    <para>First create a compatibility symlink to avoid references to /tools in
    6565    our final glibc:</para>
    6666
    6767<screen><userinput remap="pre">ln -sfv /tools/lib/gcc /usr/lib</userinput></screen>
    68 
    69     <para>Determine the GCC include directory and create a symlink for LSB
     68-->
     69    <para>Create a symlink for LSB
    7070    compliance. Additionally, for x86_64, create a compatibility symlink
    7171    required for the dynamic loader to function correctly:</para>
    7272
    7373<screen><userinput remap="pre">case $(uname -m) in
    74     i?86)    GCC_INCDIR=/usr/lib/gcc/$(uname -m)-pc-linux-gnu/&gcc-version;/include
    75             ln -sfv ld-linux.so.2 /lib/ld-lsb.so.3
     74    i?86)   ln -sfv ld-linux.so.2 /lib/ld-lsb.so.3
    7675    ;;
    77     x86_64) GCC_INCDIR=/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include
    78             ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64
     76    x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64
    7977            ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3
    8078    ;;
    8179esac</userinput></screen>
    82 
     80<!--
    8381    <para>Remove a file that may be left over from a previous build attempt:
    8482    </para>
    8583
    8684<screen><userinput remap="pre">rm -f /usr/include/limits.h</userinput></screen>
    87 
     85-->
    8886    <para>The Glibc documentation recommends building Glibc
    8987    in a dedicated build directory:</para>
     
    9492    <para>Prepare Glibc for compilation:</para>
    9593
    96 <screen><userinput remap="configure">CC="gcc -isystem $GCC_INCDIR -isystem /usr/include" \
     94<screen><userinput remap="configure">CC="gcc -ffile-prefix-map=/tools=/usr" \
    9795../configure --prefix=/usr                          \
    9896             --disable-werror                       \
    9997             --enable-kernel=&min-kernel;                    \
    10098             --enable-stack-protector=strong        \
    101              libc_cv_slibdir=/lib
    102 unset GCC_INCDIR</userinput></screen>
     99             libc_cv_slibdir=/lib</userinput></screen>
    103100
    104101   <variablelist>
     
    106103
    107104      <varlistentry>
    108         <term><parameter>CC="gcc -isystem $GCC_INCDIR -isystem /usr/include"</parameter></term>
    109         <listitem>
    110           <para>Setting the location of both gcc and system include directories
    111           avoids introduction of invalid paths in debugging symbols.</para>
     105        <term><parameter>CC="gcc -ffile-prefix-map=/tools=/usr"</parameter></term>
     106        <listitem>
     107          <para>Make GCC record any references to files in /tools in result
     108          of the compilation as if the files resided in /usr.  This avoids
     109          introduction of invalid paths in debugging symbols.</para>
    112110        </listitem>
    113111      </varlistentry>
Note: See TracChangeset for help on using the changeset viewer.