Ignore:
Timestamp:
12/20/2004 05:23:16 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
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:
24244831
Parents:
6790655
Message:

Removed text in chapter 05 - second round.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter05/gcc-pass1.xml

    r6790655 rfba1478  
    1313
    1414<sect2 role="package"><title/>
    15 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/gcc.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    1615
    1716<segmentedlist>
     
    2120</segmentedlist>
    2221
    23 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/gcc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
    24 
    2522</sect2>
    2623
    2724<sect2 role="installation">
    2825<title>Installation of GCC</title>
    29 
    30 <para>Unpack only the GCC-core tarball, as we won't be needing the C++ compiler
    31 nor the test suite here.</para>
    32 
    33 <para>This package is known to behave badly when you change its default
    34 optimization flags (including the <parameter>-march</parameter> and
    35 <parameter>-mcpu</parameter> options). Therefore, if you have defined any
    36 environment variables that override default optimizations, such as CFLAGS and
    37 CXXFLAGS, we recommend un-setting them when building GCC.</para>
    38 
    39 <para>The GCC documentation recommends building GCC outside of the source
    40 directory in a dedicated build directory:</para>
    4126
    4227<screen><userinput>mkdir ../gcc-build
     
    5035    --enable-shared --enable-languages=c</userinput></screen>
    5136
    52 <para>The meaning of the configure options:</para>
    53 
    54 <variablelist>
    55 <varlistentry>
    56 <term><parameter>CC="gcc -B/usr/bin"</parameter></term>
    57 <listitem><para>This parameter fixes a possible problem with building GCC
    58 at this stage, first noticed in LFS 5.1.1.  If our host uses a new version
    59 of Binutils than we compiled, the host compiler may try use features not
    60 supported by our new linker, causing compilation errors.  By passing the -B
    61 flag to gcc, we cause the compiler to temporarily use the host's linker,
    62 which solves the problem.</para></listitem>
    63 </varlistentry>
    64 
    65 <varlistentry>
    66 <term><parameter>--with-local-prefix=/tools</parameter></term>
    67 <listitem><para>The purpose of this switch is to remove <filename class="directory">/usr/local/include</filename>
    68 from <command>gcc</command>'s include search path. This is not absolutely
    69 essential; however, we want to try to minimize the influence of the host
    70 system, so this a sensible thing to do.</para></listitem>
    71 </varlistentry>
    72 
    73 <varlistentry>
    74 <term><parameter>--enable-shared</parameter></term>
    75 <listitem><para>This switch may
    76 seem counter-intuitive at first. But using it allows the building of
    77 <filename>libgcc_s.so.1</filename> and <filename>libgcc_eh.a</filename>, and
    78 having <filename>libgcc_eh.a</filename> available ensures that the configure
    79 script for Glibc (the next package we compile) produces the proper results.
    80 Note that the GCC binaries will still be linked
    81 statically, as this is controlled by the <parameter>-static</parameter>
    82 value of BOOT_LDFLAGS in the next step.</para></listitem>
    83 </varlistentry>
    84 
    85 <varlistentry>
    86 <term><parameter>--enable-languages=c</parameter></term>
    87 <listitem><para>This option
    88 ensures that only the C compiler is built. The option is only needed when you
    89 have downloaded and unpacked the full GCC tarball.</para></listitem>
    90 </varlistentry>
    91 </variablelist>
    92 
    9337<para>Continue with compiling the package:</para>
    9438
    9539<screen><userinput>make BOOT_LDFLAGS="-static" bootstrap</userinput></screen>
    96 
    97 <para>The meaning of the make parameters:</para>
    98 
    99 <variablelist>
    100 <varlistentry>
    101 <term><parameter>BOOT_LDFLAGS="-static"</parameter></term>
    102 <listitem><para>This tells GCC to link its programs statically.</para></listitem>
    103 </varlistentry>
    104 
    105 <varlistentry>
    106 <term><parameter>bootstrap</parameter></term>
    107 <listitem><para>This target doesn't just
    108 compile GCC, but compiles it several times. It uses the programs compiled in
    109 a first round to compile itself a second time, and then again a third time.
    110 It then compares these second and third compiles to make sure it can
    111 reproduce itself flawlessly, which most probably means that it was
    112 compiled correctly.</para></listitem>
    113 </varlistentry>
    114 </variablelist>
    115 
    116 <para>Compilation is now complete, and at this point we would normally run the
    117 test suite. But, as mentioned before, the test suite framework is not in place
    118 yet. And there would be little point in running the tests anyhow, since the
    119 programs from this first pass will soon be replaced.</para>
    12040
    12141<para>Now install the package:</para>
     
    12343<screen><userinput>make install</userinput></screen>
    12444
    125 <para>As a finishing touch we'll create a symlink. Many programs and scripts
    126 run <command>cc</command> instead of <command>gcc</command>,
    127 a thing meant to keep programs generic and therefore usable on all kinds of
    128 Unix systems. Not everybody has the GNU C compiler installed. Simply running
    129 <command>cc</command> leaves the system administrator free to decide what
    130 C compiler to install, as long as there's a symlink pointing to it:</para>
    131 
    13245<screen><userinput>ln -s gcc /tools/bin/cc</userinput></screen>
    13346
    13447</sect2>
    13548
    136 <sect2 role="content"><title/>
    137 <para>The details on this package are found in <xref linkend="contents-gcc"/>.</para>
    138 </sect2>
    139 
    14049</sect1>
Note: See TracChangeset for help on using the changeset viewer.