Ignore:
Timestamp:
02/19/2005 10:16:42 PM (19 years ago)
Author:
Gerard Beekmans <gerard@…>
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.1, 6.1.1, 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:
3d31fc4
Parents:
2f9131f
Message:

Trunk is now identical to Testing

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter05/gcc-pass2.xml

    r2f9131f r81fd230  
    88<?dbhtml filename="gcc-pass2.html"?>
    99
     10<indexterm zone="ch-tools-gcc-pass2">
     11<primary sortas="a-GCC">GCC</primary>
     12<secondary>tools, pass 2</secondary></indexterm>
     13
    1014<sect2 role="package"><title/>
    1115
     
    1620</segmentedlist>
    1721
     22<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/gcc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
     23
    1824</sect2>
    1925
     
    2127<title>Re-installation of GCC</title>
    2228
    23 <para>Check if there is PTYs for the test suites:</para>
     29<para>This package is known to have issues when its default
     30optimization flags (including the <parameter>-march</parameter> and
     31<parameter>-mcpu</parameter> options) are changed. If any environment
     32variables that override default optimizations have been defined, such
     33as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
     34unset them when building GCC.</para>
     35
     36<para>The tools required to test GCC and Binutils&mdash;Tcl, Expect
     37and DejaGNU&mdash;are installed now. GCC and Binutils can now be
     38rebuilt, linking them against the new Glibc and testing them properly
     39(if running the test suites in this chapter). Please note that these
     40test suites are highly dependent on properly functioning PTYs which
     41are provided by the host. PTYs are most commonly implemented via the
     42<systemitem class="filesystem">devpts</systemitem> file system. Check
     43to see if the host system is set up correctly in this regard by
     44performing a quick test:</para>
    2445
    2546<screen><userinput>expect -c "spawn ls"</userinput></screen>
    2647
    27 <para>Apply two patches:</para>
     48<para>The response might be:</para>
     49
     50<screen><computeroutput>The system has no more ptys. 
     51Ask your system administrator to create more.</computeroutput></screen>
     52
     53<para>If the above message is received, the host does not have its
     54PTYs set up properly. In this case, there is no point in running the
     55test suites for GCC and Binutils until this issue is resolved. Please
     56consult the LFS Wiki at <ulink url="&wiki-root;"/> for more
     57information on how to get PTYs working.</para>
     58
     59<para>Because the C and the C++ compilers will be built, unpack both
     60the core and the g++ tarballs (as well as test suite, if you want to
     61run the tests). By unpacking them in the working directory, they will
     62all unfold into a single <filename
     63class="directory">gcc-&gcc-version;/</filename> subdirectory.</para>
     64
     65<para>First correct a known problem and make an essential adjustment:</para>
    2866
    2967<screen><userinput>patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes-1.patch
    3068patch -Np1 -i ../gcc-&gcc-version;-specs-2.patch</userinput></screen>
    3169
     70<para>The first patch disables the GCC <command>fixincludes</command>
     71script. This was briefly mentioned earlier, but a more in-depth
     72explanation of the fixincludes process is warranted here. Under normal
     73circumstances, the GCC <command>fixincludes</command> script scans the
     74system for header files that need to be fixed. It might find that some
     75Glibc header files on the host system need to be fixed, and will fix
     76them and put them in the GCC private include directory. In <xref
     77linkend="chapter-building-system"/>, after the newer Glibc has been
     78installed, this private include directory will be searched before the
     79system include directory.  This may result in GCC finding the fixed
     80headers from the host system, which most likely will not match the
     81Glibc version used for the LFS system.</para>
     82
     83<para>The second patch changes GCC's default location of the dynamic
     84linker (typically <filename class="libraryfile">ld-linux.so.2</filename>). It also removes
     85<filename class="directory">/usr/include</filename> from GCC's include
     86search path. Patching now rather than adjusting the specs file after
     87installation ensures that the new dynamic linker is used during the
     88actual build of GCC. That is, all of the final (and temporary)
     89binaries created during the build will link against the new
     90Glibc.</para>
     91
     92<important><para>The above patches are critical in ensuring a
     93successful overall build. Do not forget to apply
     94them.</para></important>
     95
    3296<para>Create a separate build directory again:</para>
    3397
    3498<screen><userinput>mkdir ../gcc-build
    3599cd ../gcc-build</userinput></screen>
     100
     101<para>Before starting to build GCC, remember to unset any environment
     102variables that override the default optimization flags.</para>
    36103
    37104<para>Now prepare GCC for compilation:</para>
     
    43110    --enable-languages=c,c++ --disable-libstdcxx-pch</userinput></screen>
    44111
     112<para>The meaning of the new configure options:</para>
     113
     114<variablelist>
     115<varlistentry>
     116<term><parameter>--enable-clocale=gnu</parameter></term>
     117<listitem><para>This option ensures the correct locale model is
     118selected for the C++ libraries under all circumstances. If the
     119configure script finds the <emphasis>de_DE</emphasis> locale installed, it will select the
     120correct gnu locale model. However, if the <emphasis>de_DE</emphasis> locale is not
     121installed, there is the risk of building Application Binary Interface
     122(ABI)-incompatible C++ libraries because the incorrect generic locale
     123model may be selected.</para></listitem>
     124</varlistentry>
     125
     126<varlistentry>
     127<term><parameter>--enable-threads=posix</parameter></term>
     128<listitem><para>This enables C++ exception handling for multi-threaded
     129code.</para></listitem>
     130</varlistentry>
     131
     132<varlistentry>
     133<term><parameter>--enable-__cxa_atexit</parameter></term>
     134<listitem><para>This option allows use of
     135<emphasis>__cxa_atexit</emphasis>, rather than
     136<emphasis>atexit</emphasis>, to register C++ destructors for local
     137statics and global objects.  This option is essential for fully
     138standards-compliant handling of destructors. It also effects the C++
     139ABI, and therefore results in C++ shared libraries and C++ programs
     140that are interoperable with other Linux
     141distributions.</para></listitem>
     142</varlistentry>
     143
     144<varlistentry>
     145<term><parameter>--enable-languages=c,c++</parameter></term>
     146<listitem><para>This option
     147ensures that both the C and C++ compilers are built.</para></listitem>
     148</varlistentry>
     149
     150<varlistentry>
     151<term><parameter>--disable-libstdcxx-pch</parameter></term>
     152<listitem><para>Do not build the pre-compiled header (PCH) for
     153<filename class="libraryfile">libstdc++</filename>. It takes up a lot of space,
     154and we have no use for it.</para></listitem>
     155</varlistentry>
     156</variablelist>
     157
    45158<para>Compile the package:</para>
    46159
    47160<screen><userinput>make</userinput></screen>
    48161
    49 <para>Test the results</para>
     162<para>There is no need to use the <parameter>bootstrap</parameter>
     163target now because the compiler being used to compile this GCC was
     164built from the exact same version of the GCC sources used
     165earlier.</para>
     166
     167<para>Compilation is now complete. As previously mentioned, running
     168the test suites for the temporary tools compiled in this chapter is
     169not mandatory. To run the GCC test suite anyway, use the following
     170command:</para>
    50171
    51172<screen><userinput>make -k check</userinput></screen>
    52173
    53 <para>To get a summary of the test suite results, run this:</para>
     174<para>The <parameter>-k</parameter> flag is used to make the test suite run
     175through to completion and not stop at the first failure. The GCC test
     176suite is very comprehensive and is almost guaranteed to generate a few
     177failures. To receive a summary of the test suite results, run:</para>
    54178 
    55179<screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
    56180
    57181<para>For only the summaries, pipe the output through
    58 <userinput>grep -A7 Summ</userinput></para>
     182<userinput>grep -A7 Summ</userinput>.</para>
    59183
    60184<para>Results can be compared to those posted to the gcc-testresults
    61 mailing list to see similar configurations to the one being built. For an example of how
    62 current GCC-&gcc-version; should look on i686-pc-linux-gnu, see
    63 <ulink url="http://gcc.gnu.org/ml/gcc-testresults/2004-11/msg00569.html"/>.</para>
    64 
    65 <para>And finally install the package:</para>
     185mailing list to see similar configurations to the one being built. For
     186an example of how current GCC-&gcc-version; should look on
     187i686-pc-linux-gnu, see <ulink
     188url="http://gcc.gnu.org/ml/gcc-testresults/2004-07/msg00179.html"/>.</para>
     189
     190<para>A few unexpected failures cannot always be avoided. The
     191GCC developers are usually aware of these issues, but have not
     192resolved them yet. Unless the test results are vastly different from
     193those at the above URL, it is safe to continue.</para>
     194
     195<para>Install the package:</para>
    66196
    67197<screen><userinput>make install</userinput></screen>
    68198
    69 <note><para>At this point it is strongly recommended to repeat the sanity check
    70 we performed earlier in this chapter. Refer back to
    71 <xref linkend="ch-tools-adjusting"/> and repeat the little test compilation. If
    72 the result is wrong, then most likely you forgot to apply the above mentioned
    73 GCC Specs patch.</para></note>
     199<note><para>At this point it is strongly recommended to repeat the
     200sanity check we performed earlier in this chapter. Refer back to <xref
     201linkend="ch-tools-adjusting" role=","/> and repeat the test compilation. If
     202the result is wrong, the most likely reason is that the GCC Specs
     203patch was not properly applied.</para></note>
    74204
    75205</sect2>
    76206
     207<sect2 role="content"><title/>
     208<para>Details on this package are located in <xref
     209linkend="contents-gcc" role="."/></para>
     210</sect2>
     211
    77212</sect1>
     213
Note: See TracChangeset for help on using the changeset viewer.