| [3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
 | 
|---|
 | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
 | 
|---|
 | 3 |   "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
 | 
|---|
 | 4 |   <!ENTITY % general-entities SYSTEM "../../general.ent">
 | 
|---|
 | 5 |   %general-entities;
 | 
|---|
 | 6 | ]>
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | <sect1 id="ch-system-gcc" role="wrap">
 | 
|---|
 | 9 |   <?dbhtml filename="gcc.html"?>
 | 
|---|
 | 10 | 
 | 
|---|
 | 11 |   <title>GCC-&gcc-version;</title>
 | 
|---|
 | 12 | 
 | 
|---|
 | 13 |   <indexterm zone="ch-system-gcc">
 | 
|---|
 | 14 |     <primary sortas="a-GCC">GCC</primary>
 | 
|---|
 | 15 |   </indexterm>
 | 
|---|
 | 16 | 
 | 
|---|
 | 17 |   <sect2 role="package">
 | 
|---|
 | 18 |     <title/>
 | 
|---|
 | 19 | 
 | 
|---|
 | 20 |     <para>The GCC package contains the GNU compiler collection, which includes
 | 
|---|
 | 21 |     the C and C++ compilers.</para>
 | 
|---|
 | 22 | 
 | 
|---|
 | 23 |   </sect2>
 | 
|---|
 | 24 | 
 | 
|---|
 | 25 |   <sect2 role="installation">
 | 
|---|
 | 26 |     <title>Installation of GCC</title>
 | 
|---|
 | 27 | 
 | 
|---|
| [cc5fa6e] | 28 |     <para os="p1">The following patch fixes the searching of multilib dirs for
 | 
|---|
| [3378da5] | 29 |     specs file. The patch standardizes the gcc drivers path iteration functions,
 | 
|---|
 | 30 |     ensuring multilib directories are searched in the correct order. This fixes
 | 
|---|
 | 31 |     various issues, most noticably with libtool on multilib systems:</para>
 | 
|---|
| [d835347] | 32 | 
 | 
|---|
| [cc5fa6e] | 33 | <screen os="p2"><userinput>patch -Np1 -i ../&gcc-PR20425-patch;</userinput></screen>
 | 
|---|
| [d835347] | 34 | 
 | 
|---|
| [3f8be484] | 35 |     <para os="d">Apply a <command>sed</command> substitution that will suppress the
 | 
|---|
 | 36 |     installation of <filename class="libraryfile">libiberty.a</filename>. The
 | 
|---|
 | 37 |     version of <filename class="libraryfile">libiberty.a</filename> provided by
 | 
|---|
 | 38 |     Binutils will be used instead:</para>
 | 
|---|
 | 39 | 
 | 
|---|
 | 40 | <screen os="e"><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen>
 | 
|---|
 | 41 | 
 | 
|---|
| [bcaa438] | 42 |     <para os="e1">GCC provides a <command>gccbug</command> script which detects at
 | 
|---|
 | 43 |     compile time whether mktemp is present, and hardcodes the result in a test.
 | 
|---|
| [39139e4] | 44 |     If mktemp is not found, the script will fall back to using less
 | 
|---|
 | 45 |     random names for temporary files.  We will be installing mktemp
 | 
|---|
 | 46 |     later, so the following sed will simulate its presence:</para>
 | 
|---|
| [bcaa438] | 47 | 
 | 
|---|
| [de1676e] | 48 | <screen os="e2"><userinput>sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in</userinput></screen>
 | 
|---|
| [bcaa438] | 49 | 
 | 
|---|
| [3f8be484] | 50 |     <para os="f">The GCC documentation recommends building GCC outside of the source
 | 
|---|
 | 51 |     directory in a dedicated build directory:</para>
 | 
|---|
 | 52 | 
 | 
|---|
| [94e6142] | 53 | <screen os="g"><userinput>mkdir -v ../gcc-build
 | 
|---|
| [3f8be484] | 54 | cd ../gcc-build</userinput></screen>
 | 
|---|
 | 55 | 
 | 
|---|
 | 56 |     <para os="h">Prepare GCC for compilation:</para>
 | 
|---|
 | 57 | 
 | 
|---|
| [d55f00bc] | 58 | <screen os="i"><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
 | 
|---|
| [3f8be484] | 59 |     --libexecdir=/usr/lib --enable-shared --enable-threads=posix \
 | 
|---|
 | 60 |     --enable-__cxa_atexit --enable-c99 --enable-long-long \
 | 
|---|
| [43f3140] | 61 |     --enable-clocale=gnu --enable-languages=c,c++ \
 | 
|---|
| [a1a0762] | 62 |     --disable-multilib --disable-libstdcxx-pch</userinput></screen>
 | 
|---|
| [3f8be484] | 63 | 
 | 
|---|
| [d55f00bc] | 64 |     <para os="j">Compile the package:</para>
 | 
|---|
| [3f8be484] | 65 | 
 | 
|---|
| [450a4e5] | 66 | <screen os="k"><userinput>make bootstrap</userinput></screen>
 | 
|---|
| [3f8be484] | 67 | 
 | 
|---|
| [d55f00bc] | 68 |     <important os="l">
 | 
|---|
| [121c48a] | 69 |       <para>The test suite for GCC is considered
 | 
|---|
| [3f8be484] | 70 |       critical. Do not skip it under any circumstance.</para>
 | 
|---|
 | 71 |     </important>
 | 
|---|
 | 72 | 
 | 
|---|
| [d55f00bc] | 73 |     <para os="m">Test the results, but do not stop at errors:</para>
 | 
|---|
| [3f8be484] | 74 | 
 | 
|---|
| [d55f00bc] | 75 | <screen os="n"><userinput>make -k check</userinput></screen>
 | 
|---|
| [3f8be484] | 76 | 
 | 
|---|
| [d55f00bc] | 77 |     <para os="o">The <parameter>-k</parameter> flag is used to make the test suite
 | 
|---|
| [3f8be484] | 78 |     run through to completion and not stop at the first failure. The GCC test
 | 
|---|
 | 79 |     suite is very comprehensive and is almost guaranteed to generate a few
 | 
|---|
 | 80 |     failures. To receive a summary of the test suite results, run:</para>
 | 
|---|
 | 81 | 
 | 
|---|
| [d55f00bc] | 82 | <screen os="p"><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
 | 
|---|
| [3f8be484] | 83 | 
 | 
|---|
| [d55f00bc] | 84 |     <para os="q">For only the summaries, pipe the output through
 | 
|---|
| [3f8be484] | 85 |     <userinput>grep -A7 Summ</userinput>.</para>
 | 
|---|
 | 86 | 
 | 
|---|
 | 87 |     <para os="r">A few unexpected failures cannot always be avoided. The
 | 
|---|
 | 88 |     GCC developers are usually aware of these issues, but have not
 | 
|---|
| [d55f00bc] | 89 |     resolved them yet.</para>
 | 
|---|
| [3f8be484] | 90 | 
 | 
|---|
 | 91 |     <para os="s">Install the package:</para>
 | 
|---|
 | 92 | 
 | 
|---|
 | 93 | <screen os="t"><userinput>make install</userinput></screen>
 | 
|---|
 | 94 | 
 | 
|---|
 | 95 |     <para os="u">Some packages expect the C preprocessor to be installed in the
 | 
|---|
 | 96 |     <filename class="directory">/lib</filename> directory.
 | 
|---|
 | 97 |     To support those packages, create this symlink:</para>
 | 
|---|
 | 98 | 
 | 
|---|
| [94e6142] | 99 | <screen os="v"><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
 | 
|---|
| [3f8be484] | 100 | 
 | 
|---|
 | 101 |     <para os="w">Many packages use the name <command>cc</command> to call the C
 | 
|---|
 | 102 |     compiler. To satisfy those packages, create a symlink:</para>
 | 
|---|
 | 103 | 
 | 
|---|
| [94e6142] | 104 | <screen os="x"><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
 | 
|---|
| [3f8be484] | 105 | 
 | 
|---|
 | 106 |   </sect2>
 | 
|---|
 | 107 | 
 | 
|---|
 | 108 |   <sect2 id="contents-gcc" role="content">
 | 
|---|
 | 109 |     <title>Contents of GCC</title>
 | 
|---|
 | 110 | 
 | 
|---|
 | 111 |     <segmentedlist>
 | 
|---|
 | 112 |       <segtitle>Installed programs</segtitle>
 | 
|---|
 | 113 |       <segtitle>Installed libraries</segtitle>
 | 
|---|
 | 114 | 
 | 
|---|
 | 115 |       <seglistitem>
 | 
|---|
 | 116 |         <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg>
 | 
|---|
| [d55f00bc] | 117 |         <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libmudflap.[a,so], 
 | 
|---|
 | 118 |         libmudflapth.[a,so], libstdc++.[a,so], and
 | 
|---|
| [3f8be484] | 119 |         libsupc++.a</seg>
 | 
|---|
 | 120 |       </seglistitem>
 | 
|---|
 | 121 |     </segmentedlist>
 | 
|---|
 | 122 | 
 | 
|---|
 | 123 |     <variablelist>
 | 
|---|
 | 124 |       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
 | 
|---|
 | 125 |       <?dbfo list-presentation="list"?>
 | 
|---|
 | 126 |       <?dbhtml list-presentation="table"?>
 | 
|---|
 | 127 | 
 | 
|---|
 | 128 |       <varlistentry id="cc">
 | 
|---|
 | 129 |         <term><command>cc</command></term>
 | 
|---|
 | 130 |         <listitem>
 | 
|---|
 | 131 |           <para>The C compiler</para>
 | 
|---|
 | 132 |           <indexterm zone="ch-system-gcc cc">
 | 
|---|
 | 133 |             <primary sortas="b-cc">cc</primary>
 | 
|---|
 | 134 |           </indexterm>
 | 
|---|
 | 135 |         </listitem>
 | 
|---|
 | 136 |       </varlistentry>
 | 
|---|
 | 137 | 
 | 
|---|
 | 138 |       <varlistentry id="cpp">
 | 
|---|
 | 139 |         <term><command>cpp</command></term>
 | 
|---|
 | 140 |         <listitem>
 | 
|---|
 | 141 |           <para>The C preprocessor; it is used by the compiler to expand the
 | 
|---|
 | 142 |           #include, #define, and similar statements in the source files</para>
 | 
|---|
 | 143 |           <indexterm zone="ch-system-gcc cpp">
 | 
|---|
 | 144 |             <primary sortas="b-cpp">cpp</primary>
 | 
|---|
 | 145 |           </indexterm>
 | 
|---|
 | 146 |         </listitem>
 | 
|---|
 | 147 |       </varlistentry>
 | 
|---|
 | 148 | 
 | 
|---|
 | 149 |       <varlistentry id="c">
 | 
|---|
 | 150 |         <term><command>c++</command></term>
 | 
|---|
 | 151 |         <listitem>
 | 
|---|
 | 152 |           <para>The C++ compiler</para>
 | 
|---|
 | 153 |           <indexterm zone="ch-system-gcc c">
 | 
|---|
 | 154 |             <primary sortas="b-c++">c++</primary>
 | 
|---|
 | 155 |           </indexterm>
 | 
|---|
 | 156 |         </listitem>
 | 
|---|
 | 157 |       </varlistentry>
 | 
|---|
 | 158 | 
 | 
|---|
 | 159 |       <varlistentry id="g">
 | 
|---|
 | 160 |         <term><command>g++</command></term>
 | 
|---|
 | 161 |         <listitem>
 | 
|---|
 | 162 |           <para>The C++ compiler</para>
 | 
|---|
 | 163 |           <indexterm zone="ch-system-gcc g">
 | 
|---|
 | 164 |             <primary sortas="b-g++">g++</primary>
 | 
|---|
 | 165 |           </indexterm>
 | 
|---|
 | 166 |         </listitem>
 | 
|---|
 | 167 |       </varlistentry>
 | 
|---|
 | 168 | 
 | 
|---|
 | 169 |       <varlistentry id="gcc">
 | 
|---|
 | 170 |         <term><command>gcc</command></term>
 | 
|---|
 | 171 |         <listitem>
 | 
|---|
 | 172 |           <para>The C compiler</para>
 | 
|---|
 | 173 |           <indexterm zone="ch-system-gcc gcc">
 | 
|---|
 | 174 |             <primary sortas="b-gcc">gcc</primary>
 | 
|---|
 | 175 |           </indexterm>
 | 
|---|
 | 176 |         </listitem>
 | 
|---|
 | 177 |       </varlistentry>
 | 
|---|
 | 178 | 
 | 
|---|
 | 179 |       <varlistentry id="gccbug">
 | 
|---|
 | 180 |         <term><command>gccbug</command></term>
 | 
|---|
 | 181 |         <listitem>
 | 
|---|
 | 182 |           <para>A shell script used to help create useful bug reports</para>
 | 
|---|
 | 183 |           <indexterm zone="ch-system-gcc gccbug">
 | 
|---|
 | 184 |             <primary sortas="b-gccbug">gccbug</primary>
 | 
|---|
 | 185 |           </indexterm>
 | 
|---|
 | 186 |         </listitem>
 | 
|---|
 | 187 |       </varlistentry>
 | 
|---|
 | 188 | 
 | 
|---|
 | 189 |       <varlistentry id="gcov">
 | 
|---|
 | 190 |         <term><command>gcov</command></term>
 | 
|---|
 | 191 |         <listitem>
 | 
|---|
 | 192 |           <para>A coverage testing tool; it is used to analyze programs to
 | 
|---|
 | 193 |           determine where optimizations will have the most effect</para>
 | 
|---|
 | 194 |           <indexterm zone="ch-system-gcc gcov">
 | 
|---|
 | 195 |             <primary sortas="b-gcov">gcov</primary>
 | 
|---|
 | 196 |           </indexterm>
 | 
|---|
 | 197 |         </listitem>
 | 
|---|
 | 198 |       </varlistentry>
 | 
|---|
 | 199 | 
 | 
|---|
 | 200 |       <varlistentry id="libgcc">
 | 
|---|
 | 201 |         <term><filename class="libraryfile">libgcc</filename></term>
 | 
|---|
 | 202 |         <listitem>
 | 
|---|
 | 203 |           <para>Contains run-time support for <command>gcc</command></para>
 | 
|---|
 | 204 |           <indexterm zone="ch-system-gcc libgcc">
 | 
|---|
 | 205 |             <primary sortas="c-libgcc*">libgcc*</primary>
 | 
|---|
 | 206 |           </indexterm>
 | 
|---|
 | 207 |         </listitem>
 | 
|---|
 | 208 |       </varlistentry>
 | 
|---|
 | 209 | 
 | 
|---|
| [12a457e] | 210 |       <varlistentry id="libmudflap">
 | 
|---|
 | 211 |         <term><filename class="libraryfile">libmudflap</filename></term>
 | 
|---|
 | 212 |         <listitem>
 | 
|---|
 | 213 |           <para>The libmudflap libraries are used by GCC for instrumenting
 | 
|---|
| [3bec8f3] | 214 |           pointer and array dereferencing operations.</para>
 | 
|---|
| [12a457e] | 215 |           <indexterm zone="ch-system-gcc libmudflap">
 | 
|---|
 | 216 |             <primary sortas="c-libmudflap*">libmudflap*</primary>
 | 
|---|
 | 217 |           </indexterm>
 | 
|---|
 | 218 |         </listitem>
 | 
|---|
 | 219 |       </varlistentry>
 | 
|---|
 | 220 | 
 | 
|---|
| [3f8be484] | 221 |       <varlistentry id="libstdc">
 | 
|---|
 | 222 |         <term><filename class="libraryfile">libstdc++</filename></term>
 | 
|---|
 | 223 |         <listitem>
 | 
|---|
 | 224 |           <para>The standard C++ library</para>
 | 
|---|
 | 225 |           <indexterm zone="ch-system-gcc libstdc">
 | 
|---|
 | 226 |             <primary sortas="c-libstdc++">libstdc++</primary>
 | 
|---|
 | 227 |           </indexterm>
 | 
|---|
 | 228 |         </listitem>
 | 
|---|
 | 229 |       </varlistentry>
 | 
|---|
 | 230 | 
 | 
|---|
 | 231 |       <varlistentry id="libsupc">
 | 
|---|
 | 232 |         <term><filename class="libraryfile">libsupc++</filename></term>
 | 
|---|
 | 233 |         <listitem>
 | 
|---|
 | 234 |           <para>Provides supporting routines for the C++ programming
 | 
|---|
 | 235 |           language</para>
 | 
|---|
 | 236 |           <indexterm zone="ch-system-gcc libsupc">
 | 
|---|
 | 237 |             <primary sortas="c-libsupc++">libsupc++</primary>
 | 
|---|
 | 238 |           </indexterm>
 | 
|---|
 | 239 |         </listitem>
 | 
|---|
 | 240 |       </varlistentry>
 | 
|---|
 | 241 | 
 | 
|---|
 | 242 |     </variablelist>
 | 
|---|
 | 243 | 
 | 
|---|
 | 244 |   </sect2>
 | 
|---|
 | 245 | 
 | 
|---|
 | 246 | </sect1>
 | 
|---|