[d496aea] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[d496aea] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[b94988f] | 7 | <!ENTITY gcc3-download-http "http://ftp.gnu.org/gnu/gcc/gcc-&gcc3-version;/gcc-&gcc3-version;.tar.bz2">
|
---|
[8c9ec303] | 8 | <!ENTITY gcc3-download-ftp "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc3-version;/gcc-&gcc3-version;.tar.bz2">
|
---|
[4096f25] | 9 | <!ENTITY gcc3-md5sum "6936616a967da5a0b46f1e7424a06414">
|
---|
| 10 | <!ENTITY gcc3-size "24 MB">
|
---|
| 11 | <!ENTITY gcc3-buildsize "433 MB (includes running the test suite)">
|
---|
| 12 | <!ENTITY gcc3-time "5.2 SBU (additional 11.2 SBU to run the test suite)">
|
---|
[d496aea] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="gcc3" xreflabel="GCC-&gcc3-version;">
|
---|
[b1df977] | 16 | <?dbhtml filename="gcc3.html" ?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
[256ee72c] | 21 | <keywordset>
|
---|
| 22 | <keyword role="package">gcc-&gcc3-version;.tar</keyword>
|
---|
[22ac237] | 23 | <keyword role="ftpdir">gcc</keyword>
|
---|
[256ee72c] | 24 | </keywordset>
|
---|
[b1df977] | 25 | </sect1info>
|
---|
| 26 |
|
---|
| 27 | <title>GCC-&gcc3-version;</title>
|
---|
| 28 |
|
---|
| 29 | <indexterm zone="gcc3">
|
---|
| 30 | <primary sortas="a-GCC-3-3">GCC-&gcc3-version;</primary>
|
---|
| 31 | </indexterm>
|
---|
| 32 |
|
---|
| 33 | <sect2 role="package">
|
---|
| 34 | <title>Introduction to GCC-&gcc3-version;</title>
|
---|
| 35 |
|
---|
[b90045c] | 36 | <para>There are several reasons why you may wish to install
|
---|
| 37 | <application>GCC</application>-&gcc3-version;. Some packages have not been
|
---|
| 38 | updated so they can be successfully compiled by
|
---|
| 39 | <application>GCC</application>-&gcc-version; as
|
---|
| 40 | version 4.x.x of <application>GCC</application> is much stricter in
|
---|
| 41 | enforcing coding standards. Additionally, some pre-compiled packages may
|
---|
| 42 | require the <application>GCC</application>-&gcc3-version; libraries at
|
---|
| 43 | run-time. Another reason you may need to install
|
---|
| 44 | <application>GCC</application>-&gcc3-version; is to use the
|
---|
| 45 | <command>g77</command> Fortran 77 compiler provided by pre-4.x.x versions
|
---|
| 46 | of <application>GCC</application>. <application>GCC</application>-4.x.x
|
---|
| 47 | only includes <command>gfortran</command>, a Fortran 95 compatible compiler
|
---|
| 48 | that is not yet ready to be used in a production environment.</para>
|
---|
| 49 |
|
---|
| 50 | <para>If all you need is a working <command>{f,g}77</command> Fortran 77
|
---|
| 51 | compiler, you may wish to use the one provided by
|
---|
| 52 | <application>GCC</application>-3.4.x. This is what the
|
---|
| 53 | <application>GCC</application> developers recommend. Instructions for
|
---|
| 54 | building the <application>GCC</application>-3.4.x Fortran compiler can be
|
---|
| 55 | found on the
|
---|
| 56 | <ulink url="http://wiki.linuxfromscratch.org/blfs/wiki/gcc3">BLFS
|
---|
| 57 | Wiki</ulink>.</para>
|
---|
[b1df977] | 58 |
|
---|
| 59 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 60 | <itemizedlist spacing="compact">
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>Download (HTTP): <ulink url="&gcc3-download-http;"/></para>
|
---|
| 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>Download (FTP): <ulink url="&gcc3-download-ftp;"/></para>
|
---|
| 66 | </listitem>
|
---|
| 67 | <listitem>
|
---|
| 68 | <para>Download MD5 sum: &gcc3-md5sum;</para>
|
---|
| 69 | </listitem>
|
---|
| 70 | <listitem>
|
---|
| 71 | <para>Download size: &gcc3-size;</para>
|
---|
| 72 | </listitem>
|
---|
| 73 | <listitem>
|
---|
| 74 | <para>Estimated disk space required: &gcc3-buildsize;</para>
|
---|
| 75 | </listitem>
|
---|
| 76 | <listitem>
|
---|
| 77 | <para>Estimated build time: &gcc3-time;</para>
|
---|
| 78 | </listitem>
|
---|
| 79 | </itemizedlist>
|
---|
| 80 |
|
---|
| 81 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 82 | <itemizedlist spacing='compact'>
|
---|
| 83 | <listitem>
|
---|
[7cd76d62] | 84 | <para>Required patch: <ulink
|
---|
[b1df977] | 85 | url="&patch-root;/gcc-&gcc3-version;-no_fixincludes-1.patch"/></para>
|
---|
| 86 | </listitem>
|
---|
| 87 | <listitem>
|
---|
[7cd76d62] | 88 | <para>Required patch: <ulink
|
---|
[b1df977] | 89 | url="&patch-root;/gcc-&gcc3-version;-linkonce-1.patch"/></para>
|
---|
| 90 | </listitem>
|
---|
| 91 | </itemizedlist>
|
---|
| 92 |
|
---|
| 93 | <bridgehead renderas="sect3">GCC-&gcc3-version; Dependencies</bridgehead>
|
---|
[256ee72c] | 94 |
|
---|
| 95 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 96 | <para role="optional"><xref linkend="dejagnu"/> (required to run the full test suite)</para>
|
---|
[b1df977] | 97 |
|
---|
[1039de3] | 98 | <para condition="html" role="usernotes">User Notes:
|
---|
| 99 | <ulink url="&blfs-wiki;/gcc3"/></para>
|
---|
| 100 |
|
---|
[b1df977] | 101 | </sect2>
|
---|
| 102 |
|
---|
| 103 | <sect2 role="installation">
|
---|
| 104 | <title>Installation of GCC-&gcc3-version;</title>
|
---|
| 105 |
|
---|
[7cd76d62] | 106 | <para>Install <application>GCC</application>-&gcc3-version; by running
|
---|
[b1df977] | 107 | the following commands:</para>
|
---|
| 108 |
|
---|
| 109 | <screen><userinput>patch -Np1 -i ../gcc-&gcc3-version;-no_fixincludes-1.patch &&
|
---|
[b94988f] | 110 | patch -Np1 -i ../gcc-&gcc3-version;-linkonce-1.patch &&
|
---|
| 111 | mkdir ../gcc-build &&
|
---|
| 112 | cd ../gcc-build &&
|
---|
[4096f25] | 113 | ../gcc-&gcc3-version;/configure --prefix=/opt/gcc-&gcc3-version; \
|
---|
| 114 | --enable-shared --enable-languages=c,c++ --enable-threads=posix &&
|
---|
[b1df977] | 115 | make bootstrap</userinput></screen>
|
---|
[d260aaf4] | 116 |
|
---|
[7cd76d62] | 117 | <para>If desired, run the test suite using the following commands. The
|
---|
| 118 | <command>test_summary</command> commands create log files which can be
|
---|
| 119 | compared to known good results located at <ulink
|
---|
[0f9a8a99] | 120 | url="&files-anduin;/gcc336_test.txt"/>.</para>
|
---|
[fb9298b4] | 121 |
|
---|
[b1df977] | 122 | <screen><userinput>make -k check &&
|
---|
[4096f25] | 123 | ../gcc-&gcc3-version;/contrib/test_summary >test_summary.log 2>&1 &&
|
---|
| 124 | ../gcc-&gcc3-version;/contrib/test_summary | \
|
---|
[b1df977] | 125 | grep -A7 Summ >test_summary_short.log 2>&1</userinput></screen>
|
---|
[fb9298b4] | 126 |
|
---|
[b1df977] | 127 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[d260aaf4] | 128 |
|
---|
[b1df977] | 129 | <screen role="root"><userinput>make install &&
|
---|
[f079a990] | 130 | mv -v /opt/gcc-&gcc3-version;/lib/libstdc++.so.5* /usr/lib &&
|
---|
[4096f25] | 131 | ln -v -sf /usr/lib/libstdc++.so.5.0.7 /opt/gcc-&gcc3-version;/lib &&
|
---|
| 132 | ln -v -sf libstdc++.so.5.0.7 /opt/gcc-&gcc3-version;/lib/libstdc++.so.5 &&
|
---|
[f079a990] | 133 | chown -v -R root:root \
|
---|
[b1df977] | 134 | /opt/gcc-&gcc3-version;/lib/gcc-lib/i686-pc-linux-gnu/&gcc3-version;/include</userinput></screen>
|
---|
[b94988f] | 135 |
|
---|
[b1df977] | 136 | </sect2>
|
---|
[d496aea] | 137 |
|
---|
[b1df977] | 138 | <sect2 role="commands">
|
---|
| 139 | <title>Command Explanations</title>
|
---|
[d496aea] | 140 |
|
---|
[7cd76d62] | 141 | <para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
|
---|
| 142 | <application>GCC</application> development team recommends
|
---|
[b1df977] | 143 | building in a separate directory.</para>
|
---|
[d496aea] | 144 |
|
---|
[ca4b09e] | 145 | <para id='gcc3-lang'><parameter>--enable-shared --enable-languages=c,c++
|
---|
[7cd76d62] | 146 | --enable-threads=posix</parameter>: Configures
|
---|
[ca4b09e] | 147 | <application>GCC</application> to build the <application>C</application>
|
---|
| 148 | and <application>C++</application> compilers and enable the related
|
---|
| 149 | <application>C++</application> options. In addition to c and c++, you can
|
---|
| 150 | add f77 for FORTRAN (called <application>g77</application>) and objc for
|
---|
| 151 | Objective C libraries. Note that <application>GCC-4</application> no
|
---|
| 152 | longer provides a FORTRAN 77 compiler. Ada is a more complicated
|
---|
| 153 | installation and not supported in BLFS.</para>
|
---|
| 154 |
|
---|
| 155 | <indexterm zone="gcc3 gcc3-lang">
|
---|
| 156 | <primary sortas="b-g77">g77</primary>
|
---|
| 157 | </indexterm>
|
---|
| 158 | <indexterm zone="gcc3 gcc3-lang">
|
---|
| 159 | <primary sortas="b-FORTRAN">FORTRAN</primary>
|
---|
| 160 | </indexterm>
|
---|
| 161 | <indexterm zone="gcc3 gcc3-lang">
|
---|
| 162 | <primary sortas="b-ObjeciveC">Objective C</primary>
|
---|
| 163 | </indexterm>
|
---|
| 164 |
|
---|
[7cd76d62] | 165 | <para><command>mv -v /opt/gcc-&gcc3-version;/lib/libstdc++.so.5*
|
---|
[4096f25] | 166 | /usr/lib</command>: Moves the <application>C++</application> library to the
|
---|
[7cd76d62] | 167 | standard lib directory to avoid having to add
|
---|
| 168 | <userinput>/opt/gcc-&gcc3-version;/lib</userinput> to
|
---|
[b1df977] | 169 | <filename>/etc/ld.so.conf</filename>.</para>
|
---|
[d496aea] | 170 |
|
---|
[b1df977] | 171 | </sect2>
|
---|
[d496aea] | 172 |
|
---|
[b1df977] | 173 | <sect2 role="configuration">
|
---|
| 174 | <title>Configuring GCC-&gcc3-version;</title>
|
---|
[d496aea] | 175 |
|
---|
[b1df977] | 176 | <sect3>
|
---|
| 177 | <title>Configuration information</title>
|
---|
[d496aea] | 178 |
|
---|
[4096f25] | 179 | <para>If you only need the GCC-&gcc3-version; C++ library, you may delete
|
---|
[b1df977] | 180 | <filename>/opt/gcc-&gcc3-version;</filename>.</para>
|
---|
[d496aea] | 181 |
|
---|
[b1df977] | 182 | <para>Whenever you need to use GCC-&gcc3-version; instead of your system
|
---|
| 183 | installed compiler, add
|
---|
[7cd76d62] | 184 | <filename class="directory">/opt/gcc-&gcc3-version;/bin</filename> to the
|
---|
[b1df977] | 185 | front of your <envar>PATH</envar> or (preferably) set the <envar>CC</envar>
|
---|
| 186 | environment variable before compiling the concerned package.</para>
|
---|
[d496aea] | 187 |
|
---|
[ca4b09e] | 188 | <para>If you need <application>g77</application> or Objective C
|
---|
| 189 | libraries, you also need to either update
|
---|
| 190 | <filename>/etc/ld.so.conf</filename> to point to <filename
|
---|
| 191 | class='directory'>/opt/gcc-&gcc3-version;/lib</filename> and run
|
---|
| 192 | <application>ldconfig</application> or export
|
---|
| 193 | LD_LIBRARY_PATH=/opt/gcc-&gcc3-version;/lib.</para>
|
---|
| 194 |
|
---|
[b1df977] | 195 | </sect3>
|
---|
[d496aea] | 196 |
|
---|
[b1df977] | 197 | </sect2>
|
---|
[d496aea] | 198 |
|
---|
[b1df977] | 199 | <sect2 role="content">
|
---|
| 200 | <title>Contents</title>
|
---|
[d496aea] | 201 |
|
---|
[b1df977] | 202 | <segmentedlist>
|
---|
| 203 | <segtitle>Installed Programs</segtitle>
|
---|
| 204 | <segtitle>Installed Libraries</segtitle>
|
---|
[40d6bab] | 205 | <segtitle>Installed Directory</segtitle>
|
---|
[b94988f] | 206 |
|
---|
[b1df977] | 207 | <seglistitem>
|
---|
[7cd76d62] | 208 | <seg>c++, cpp, g++, gcc, gccbug, gcov, and architecture specific
|
---|
[b1df977] | 209 | names of these programs.</seg>
|
---|
[1039de3] | 210 | <seg>libgcc_s.so, libiberty.a, libstdc++.{a,so}, libsupc++.a, and other
|
---|
[b1df977] | 211 | support libraries and files.</seg>
|
---|
| 212 | <seg>/opt/gcc-&gcc3-version;</seg>
|
---|
| 213 | </seglistitem>
|
---|
| 214 | </segmentedlist>
|
---|
[d496aea] | 215 |
|
---|
[b1df977] | 216 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 217 |
|
---|
| 218 | <para>The GCC-&gcc3-version; package contains the
|
---|
| 219 | <command>gcc</command>-&gcc3-version; <application>C</application> and
|
---|
[40d6bab] | 220 | <application>C++</application> compilers and the GCC-&gcc3-version;
|
---|
| 221 | <filename>libstdc++.so</filename> library that is required by some
|
---|
| 222 | commercial and pre-compiled packages.</para>
|
---|
[b1df977] | 223 |
|
---|
| 224 | </sect2>
|
---|
[d496aea] | 225 |
|
---|
| 226 | </sect1>
|
---|