Ignore:
Timestamp:
09/15/2007 08:45:13 PM (17 years ago)
Author:
Jeremy Huntwork <jhuntwork@…>
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, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 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:
2a7ac34
Parents:
232aa73
Message:

Upgrade to GCC-4.2.1. Fixes #2002. Merged from jh branch, thanks to Matthew Burgess for preparing a discrete patch.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8374 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter05/gcc-pass2.xml

    r232aa73 rb0a4c9a  
    9191  &gt; gcc/Makefile.in</userinput></screen>
    9292
    93     <para>Apply the following patch to change the location of GCC's default
    94     dynamic linker (typically <filename
    95     class="libraryfile">ld-linux.so.2</filename>):</para>
    96 
    97 <screen><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
    98 
    99     <para>The above patch also removes <filename
     93    <para>The following command will change the location of GCC's default
     94    dynamic linker to use the one we installed in
     95    <filename class="directory">/tools</filename>. It also removes <filename
    10096    class="directory">/usr/include</filename> from GCC's include search path.
    101     Patching now rather than adjusting the specs file after installation
     97    Doing this now rather than adjusting the specs file after installation
    10298    ensures that the new dynamic linker is used during the actual build of
    10399    GCC. That is, all of the binaries created during the build will link
    104     against the new Glibc.</para>
    105 
    106     <important>
    107       <para>The above patch is critical in ensuring a successful overall
    108       build. Do not forget to apply it.</para>
    109     </important>
     100    against the new Glibc. Issue:</para>
     101
     102<screen><userinput>for file in $(find gcc/config -name linux64.h -o -name linux.h)
     103do
     104  cp -uv $file{,.orig}
     105  sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' \
     106  -e 's@/usr@/tools@g' $file.orig &gt; $file
     107  echo "
     108#undef STANDARD_INCLUDE_DIR
     109#define STANDARD_INCLUDE_DIR 0" &gt;&gt; $file
     110  touch $file.orig
     111done</userinput></screen>
     112
     113    <para>In case the above seems hard to follow, let's break it down a bit.
     114    First we find all the files under the gcc/config directory that are named
     115    either <filename>linux.h</filename> or <filename>linux64.h</filename>.
     116    For each file found, we copy it to a file of the same name but with an added
     117    suffix of <quote>.orig</quote>. Then the first sed expression prepends
     118    <quote>/tools</quote> to every instance of <quote>/lib/ld</quote>,
     119    <quote>/lib64/ld</quote> or <quote>/lib32/ld</quote>, while the second one
     120    replaces hard-coded instances of <quote>/usr</quote>. Then we add our define
     121    statements which alter the include search path to the end of the file. Finally,
     122    we use <command>touch</command> to update the timestamp on the copied files.
     123    When used in conjunction with <command>cp -u</command>, this prevents unexpected
     124    changes to the original files in case the command is inadvertently run twice.
     125    </para>
    110126
    111127    <para>Create a separate build directory again:</para>
     
    123139    --enable-shared --enable-threads=posix \
    124140    --enable-__cxa_atexit --enable-languages=c,c++ \
    125     --disable-libstdcxx-pch</userinput></screen>
     141    --disable-libstdcxx-pch --disable-bootstrap</userinput></screen>
    126142
    127143    <variablelist>
     
    178194      </varlistentry>
    179195
     196      <varlistentry>
     197        <term><parameter>--disable-bootstrap</parameter></term>
     198        <listitem>
     199          <para>Bootstrapping the compiler is now the default for GCC. However,
     200          our build method should provide us with a solid compiler without the
     201          need to bootstrap each time.</para>
     202        </listitem>
     203      </varlistentry>
     204
    180205    </variablelist>
    181206
Note: See TracChangeset for help on using the changeset viewer.