Ignore:
Timestamp:
09/09/2005 08:34:44 PM (19 years ago)
Author:
Matthew Burgess <matthew@…>
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.3, 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:
80d66d1
Parents:
98fe721
Message:

Upgrade to gcc-4.0.1 (merge of gcc4 branch)

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter05/gcc-pass2.xml

    r98fe721 r2e02c35  
    5959working.</para>
    6060
    61 <para>First correct a known problem and make an essential adjustment:</para>
    62 
    63 <screen><userinput>patch -Np1 -i ../&gcc-no_fixincludes-patch;
    64 patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
    65 
    66 <para>The first patch disables the GCC <command>fixincludes</command>
    67 script. This was briefly mentioned earlier, but a more in-depth
    68 explanation of the fixincludes process is warranted here. Under normal
    69 circumstances, the GCC <command>fixincludes</command> script scans the
    70 system for header files that need to be fixed. It might find that some
    71 Glibc header files on the host system need to be fixed, and will fix
    72 them and put them in the GCC private include directory. In <xref
    73 linkend="chapter-building-system"/>, after the newer Glibc has been
    74 installed, this private include directory will be searched before the
    75 system include directory.  This may result in GCC finding the fixed
    76 headers from the host system, which most likely will not match the
    77 Glibc version used for the LFS system.</para>
    78 
    79 <para>The second patch changes GCC's default location of the dynamic
    80 linker (typically <filename class="libraryfile">ld-linux.so.2</filename>). It also removes
    81 <filename class="directory">/usr/include</filename> from GCC's include
    82 search path. Patching now rather than adjusting the specs file after
    83 installation ensures that the new dynamic linker is used during the
    84 actual build of GCC. That is, all of the final (and temporary)
    85 binaries created during the build will link against the new
     61<para>Under normal circumstances, the GCC <command>fixincludes</command> script
     62scans the system for header files that need to be fixed (they may contain syntax
     63errors, for example).  The script might find that some Glibc header files on the
     64host system need to be fixed, so fixes them and puts them in the GCC private
     65include directory. In <xref linkend="chapter-building-system"/>, after the
     66newer Glibc has been installed, this private include directory will be searched
     67before the system include directory.  This may result in GCC finding the fixed
     68headers from the host system, which most likely will not match the Glibc version
     69used for the LFS system.</para>
     70
     71<para>The following command adjusts where the GCC <command>fixincludes</command>
     72script searches for headers, so that it fixes only the new headers under
     73<filename class="directory">/tools</filename>, not the ones from your host
     74system.</para>
     75
     76<screen><userinput>cp gcc/Makefile.in{,.orig} &amp;&amp;
     77sed 's@\(^NATIVE_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g' \
     78      gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>
     79
     80<para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/>
     81built GCC with the <option>-fomit-frame-pointer</option> compiler flag.
     82Non-bootstrap builds omit this flag by default, so apply the following
     83<command>sed</command> to use it in order to ensure consistent compiler builds.
     84</para>
     85
     86<screen><userinput>cp gcc/Makefile.in{,.tmp} &amp;&amp;
     87sed 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in.tmp \
     88        &gt; gcc/Makefile.in</userinput></screen>
     89
     90<para>Apply the following patch to change the location of GCC's default dynamic
     91linker (typically <filename class="libraryfile">ld-linux.so.2</filename>):</para>
     92
     93<screen><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
     94
     95<para>The above patch also removes
     96<filename class="directory">/usr/include</filename> from GCC's include search
     97path. Patching now rather than adjusting the specs file after installation
     98ensures that the new dynamic linker is used during the actual build of GCC. That
     99is, all of the binaries created during the build will link against the new
    86100Glibc.</para>
    87101
    88 <important><para>The above patches are critical in ensuring a
     102<important><para>The above patch is critical in ensuring a
    89103successful overall build. Do not forget to apply
    90 them.</para></important>
     104it.</para></important>
    91105
    92106<para>Create a separate build directory again:</para>
     
    181195url="&test-results;"/>.</para>
    182196
    183 <para>A few unexpected failures cannot always be avoided. The
    184 GCC developers are usually aware of these issues, but have not
    185 resolved them yet. Unless the test results are vastly different from
    186 those at the above URL, it is safe to continue.</para>
     197<para>A few unexpected failures cannot always be avoided. The GCC developers are
     198usually aware of these issues, but have not resolved them yet. In particular,
     199the <filename class="libraryfile">libmudflap</filename> tests are known be
     200particularly problematic as a result of a bug in GCC (<ulink
     201url="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20003"/>).  Unless the test
     202results are vastly different from those at the above URL, it is safe to
     203continue.</para>
    187204
    188205<para>Install the package:</para>
Note: See TracChangeset for help on using the changeset viewer.