Changeset 7681a57


Ignore:
Timestamp:
01/11/2003 06:04:52 PM (21 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.0, 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, v4_1, v5_0, v5_1, v5_1_1, 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:
ab28d5f
Parents:
0416698d
Message:

Redid GCC installation page

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

Files:
1 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • appendixa/gcc-dep.xml

    r0416698d r7681a57  
     1<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
     2
    13<sect2>
    24<title>GCC Installation Dependencies</title>
  • appendixa/gcc-desc.xml

    r0416698d r7681a57  
    1 <sect2><title>Contents of GCC</title>
     1<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
     2
     3<sect2><title>Descriptions</title>
    24
    35<para>Last checked against version &gcc-contversion;.</para>
    46
    5 <sect3><title>Program Files</title>
    6 <para>c++, c++filt, cc (link to gcc), cc1, cc1plus, collect2, cpp, cpp0,
    7 g++, gcc, gccbug, gcov and tradcpp0</para></sect3>
    8 
    9 <sect3><title>Descriptions</title>
     7<sect3><title>Program files descriptions</title>
    108
    119<sect4><title>cc, cc1, cc1plus, gcc</title>
     
    5048</sect3>
    5149
    52 <sect3><title>Library Files</title>
    53 <para>libgcc.a, libgcc_eh.a, libgcc_s.so, libiberty.a, libstdc++.[a,so],
    54 libsupc++.a</para></sect3>
    55 
    56 <sect3><title>Descriptions</title>
     50<sect3><title>Library files descriptions</title>
    5751
    5852<sect4><title>libgcc, libgcc_eh, libgcc_s</title>
  • appendixa/gcc.xml

    r0416698d r7681a57  
    44
    55&aa-gcc-down;
     6&aa-gcc-shortdesc;
    67&aa-gcc-desc;
    78&aa-gcc-dep;
  • chapter05/gcc-inst.xml

    r0416698d r7681a57  
     1<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
     2
    13<sect2>
    24<title>Installation of GCC</title>
     
    1214been warned.</para>
    1315
    14 <para>Install GCC by running the following commands:</para>
     16<para>It is recommended by the GCC installation documentation to build
     17GCC outside of the source directory in a dedicated directory:</para>
    1518
    16 <para><screen><userinput>mkdir ../gcc-build &amp;&amp;
    17 cd ../gcc-build &amp;&amp;
    18 ../gcc-&gcc-version;/configure --prefix=/static \
     19<para><screen><userinput>mkdir ../gcc-build
     20cd ../gcc-build</userinput></screen></para>
     21
     22<para>Prepare GCC to be compiled:</para>
     23
     24<para><screen><userinput>../gcc-&gcc-version;/configure --prefix=/static \
    1925&nbsp;&nbsp;&nbsp;--disable-nls --disable-shared \
    2026&nbsp;&nbsp;&nbsp;--with-as=$LFS/static/bin/as \
    21 &nbsp;&nbsp;&nbsp;--with-ld=$LFS/static/bin/ld &amp;&amp;
    22 make BOOT_LDFLAGS="-static" bootstrap &amp;&amp;
    23 make prefix=$LFS/static install-no-fixedincludes &amp;&amp;
    24 ln -s gcc $LFS/static/bin/cc</userinput></screen></para>
     27&nbsp;&nbsp;&nbsp;--with-ld=$LFS/static/bin/ld</userinput></screen></para>
     28
     29<para>The meaning of the configure options are:</para>
     30
     31<itemizedlist>
     32<listitem><para><userinput>--prefix=/static:</userinput> This is NOT a
     33typo. GCC hard codes some paths while compiling and so we need to pass
     34<filename class="directory">/static</filename> as the prefix during the
     35configure stage. We pass the real install prefix during the installation
     36stage later on.</para></listitem>
     37
     38<listitem><para><userinput>--disable-shared:</userinput> This prevents the
     39build of dynamic libraries. They are useless to us at the moment. We'll
     40create them when we reinstall GCC in chapter 6.</para></listitem>
     41
     42<listitem><para><userinput>--with-as=$LFS/static/bin/as and
     43--with-ld=$LFS/static/bin/ld:</userinput> GCC can be miscompiled if your
     44host distribution's Binutils package is quite old. We need a good working
     45static GCC until we reinstall GCC later in chapter 6. So by using
     46<filename>as</filename> and <filename>ld</filename> from the Binutils
     47package we compiled earlier in this chapter we ensure that GCC will work
     48correctly.</para></listitem>
     49</itemizedlist>
     50
     51<para>Continue with compiling the package:</para>
     52
     53<para><screen><userinput>make BOOT_LDFLAGS="-static" bootstrap</userinput></screen></para>
     54
     55<para>The meaning of the make options are:</para>
     56
     57<itemizedlist>
     58<listitem><para><userinput>BOOT_LDFLAGS="-static":</userinput> This is
     59GCC's equivalent to make LDFLAGS="-static" as we use with other packages to
     60compile them statically.</para></listitem>
     61
     62<listitem><para><userinput>bootstrap:</userinput> The
     63<emphasis>bootstrap</emphasis> target doesn't just compile GCC, but it
     64compiles GCC a second time. It uses the first compiled programs to compile
     65itself a second and third time to make sure the compiler compiled properly
     66and can compile itself properly.</para></listitem>
     67</itemizedlist>
     68
     69<para>And finish off installing the package:</para>
     70
     71<para><screen><userinput>make prefix=$LFS/static install-no-fixedincludes</userinput></screen></para>
     72
     73<para>The meaning of the make option is:</para>
     74
     75<itemizedlist>
     76<listitem><para><userinput>install-no-fixedincludes:</userinput> This prevents
     77the fixincludes script from running. Preventing this is necessary because
     78under normal circumstances the GCC installation will run the fixincludes
     79script which scans your system for header files that need to be fixed. It
     80might find that the Glibc header files of your host system need to be fixed.
     81If so, it will fix them and put them in
     82<filename>$LFS/static/lib/gcc-lib/i686-pc-linux-gnu/3.2</filename>. Later on
     83in chapter 6 you will install Glibc which will put its header files in
     84<filename>/usr/include</filename>. Next you will install other programs that
     85use the Glibc headers. GCC will look in
     86<filename>/static/lib/gcc-lib</filename> before looking in
     87<filename>/usr/include</filename>, with the result of finding and using the
     88fixed Glibc header files from your host distribution, which are probably
     89incompatible with the Glibc version actually used on the LFS
     90system.</para></listitem>
     91</itemizedlist>
     92
     93<para>As the finishing touch we'll create the <filename
     94class="symlink">$LFS/static/bin/cc</filename> symlink. A lot of programs
     95and scripts try to run <userinput>cc</userinput> instead of
     96<userinput>gcc</userinput> This is to keep programs generic and usable on
     97all kinds of Unix systems. Not everybody has GNU CC installed. Just running
     98cc (C Compiler) leaves the user free to decide which C compiler to install.
     99The symlink will point to the system's default compiler.</para>
     100
     101<para><screen><userinput>ln -s gcc $LFS/static/bin/cc</userinput></screen></para>
    25102
    26103</sect2>
  • chapter05/gcc.xml

    r0416698d r7681a57  
    66Estimated required disk space:  &gcc-compsize-static;</screen>
    77
     8&aa-gcc-shortdesc;
     9&aa-gcc-dep;
    810&c5-gcc-inst;
    9 &c5-gcc-exp;
    10 &aa-gcc-desc;
    11 &aa-gcc-dep;
    1211
    1312</sect1>
  • entities/gcc.ent

    r0416698d r7681a57  
    44<!ENTITY c5-gcc SYSTEM "../chapter05/gcc.xml">
    55<!ENTITY c5-gcc-inst SYSTEM "../chapter05/gcc-inst.xml">
    6 <!ENTITY c5-gcc-exp SYSTEM "../chapter05/gcc-exp.xml">
    76
    87<!ENTITY c6-gcc SYSTEM "../chapter06/gcc.xml">
     
    1110
    1211<!ENTITY aa-gcc SYSTEM "../appendixa/gcc.xml">
     12<!ENTITY aa-gcc-shortdesc SYSTEM "../appendixa/gcc-shortdesc.xml">
    1313<!ENTITY aa-gcc-desc SYSTEM "../appendixa/gcc-desc.xml">
    1414<!ENTITY aa-gcc-dep SYSTEM "../appendixa/gcc-dep.xml">
Note: See TracChangeset for help on using the changeset viewer.