[3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[aa18ac0] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[3f8be484] | 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 |
|
---|
[e05c4f0] | 28 |
|
---|
[3e0fdeb] | 29 | <para os="p1">The following patch contains a number of updates to the
|
---|
[78ff659f] | 30 | &gcc-version; branch by the GCC developers:</para>
|
---|
[b369f3c] | 31 |
|
---|
[3e0fdeb] | 32 | <screen os="p2"><userinput>patch -Np1 -i ../&gcc-branch_update-patch;</userinput></screen>
|
---|
[b369f3c] | 33 |
|
---|
[3f8be484] | 34 | <para os="d">Apply a <command>sed</command> substitution that will suppress the
|
---|
| 35 | installation of <filename class="libraryfile">libiberty.a</filename>. The
|
---|
| 36 | version of <filename class="libraryfile">libiberty.a</filename> provided by
|
---|
| 37 | Binutils will be used instead:</para>
|
---|
| 38 |
|
---|
| 39 | <screen os="e"><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen>
|
---|
| 40 |
|
---|
| 41 | <para os="f">The GCC documentation recommends building GCC outside of the source
|
---|
| 42 | directory in a dedicated build directory:</para>
|
---|
| 43 |
|
---|
[94e6142] | 44 | <screen os="g"><userinput>mkdir -v ../gcc-build
|
---|
[3f8be484] | 45 | cd ../gcc-build</userinput></screen>
|
---|
| 46 |
|
---|
| 47 | <para os="h">Prepare GCC for compilation:</para>
|
---|
| 48 |
|
---|
[b6831b6] | 49 | <screen os="i"><userinput>CC="gcc -isystem /usr/include" \
|
---|
| 50 | CXX="g++ -isystem /usr/include" \
|
---|
| 51 | LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib" \
|
---|
| 52 | ../gcc-&gcc-version;/configure --prefix=/usr \
|
---|
[3f8be484] | 53 | --libexecdir=/usr/lib --enable-shared --enable-threads=posix \
|
---|
| 54 | --enable-__cxa_atexit --enable-c99 --enable-long-long \
|
---|
[43f3140] | 55 | --enable-clocale=gnu --enable-languages=c,c++ \
|
---|
[84b164e] | 56 | --disable-multilib --disable-libstdcxx-pch \
|
---|
| 57 | --enable-cloog-backend=isl</userinput></screen>
|
---|
[3f8be484] | 58 |
|
---|
[d55f00bc] | 59 | <para os="j">Compile the package:</para>
|
---|
[3f8be484] | 60 |
|
---|
[f568131] | 61 | <screen os="k"><userinput>make</userinput></screen>
|
---|
[3f8be484] | 62 |
|
---|
[d55f00bc] | 63 | <important os="l">
|
---|
[121c48a] | 64 | <para>The test suite for GCC is considered
|
---|
[3f8be484] | 65 | critical. Do not skip it under any circumstance.</para>
|
---|
| 66 | </important>
|
---|
| 67 |
|
---|
[d55f00bc] | 68 | <para os="m">Test the results, but do not stop at errors:</para>
|
---|
[3f8be484] | 69 |
|
---|
[d55f00bc] | 70 | <screen os="n"><userinput>make -k check</userinput></screen>
|
---|
[3f8be484] | 71 |
|
---|
[d55f00bc] | 72 | <para os="o">The <parameter>-k</parameter> flag is used to make the test suite
|
---|
[3f8be484] | 73 | run through to completion and not stop at the first failure. The GCC test
|
---|
| 74 | suite is very comprehensive and is almost guaranteed to generate a few
|
---|
| 75 | failures. To receive a summary of the test suite results, run:</para>
|
---|
| 76 |
|
---|
[d55f00bc] | 77 | <screen os="p"><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
|
---|
[3f8be484] | 78 |
|
---|
[d55f00bc] | 79 | <para os="q">For only the summaries, pipe the output through
|
---|
[3f8be484] | 80 | <userinput>grep -A7 Summ</userinput>.</para>
|
---|
| 81 |
|
---|
| 82 | <para os="r">A few unexpected failures cannot always be avoided. The
|
---|
| 83 | GCC developers are usually aware of these issues, but have not
|
---|
[d55f00bc] | 84 | resolved them yet.</para>
|
---|
[3f8be484] | 85 |
|
---|
| 86 | <para os="s">Install the package:</para>
|
---|
| 87 |
|
---|
| 88 | <screen os="t"><userinput>make install</userinput></screen>
|
---|
| 89 |
|
---|
| 90 | <para os="u">Some packages expect the C preprocessor to be installed in the
|
---|
| 91 | <filename class="directory">/lib</filename> directory.
|
---|
| 92 | To support those packages, create this symlink:</para>
|
---|
| 93 |
|
---|
[94e6142] | 94 | <screen os="v"><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
|
---|
[3f8be484] | 95 |
|
---|
| 96 | <para os="w">Many packages use the name <command>cc</command> to call the C
|
---|
| 97 | compiler. To satisfy those packages, create a symlink:</para>
|
---|
| 98 |
|
---|
[94e6142] | 99 | <screen os="x"><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
|
---|
[3f8be484] | 100 |
|
---|
| 101 | </sect2>
|
---|
| 102 |
|
---|
| 103 | <sect2 id="contents-gcc" role="content">
|
---|
| 104 | <title>Contents of GCC</title>
|
---|
| 105 |
|
---|
| 106 | <segmentedlist>
|
---|
| 107 | <segtitle>Installed programs</segtitle>
|
---|
| 108 | <segtitle>Installed libraries</segtitle>
|
---|
[61ad0b7f] | 109 | <segtitle>Installed directories</segtitle>
|
---|
[3f8be484] | 110 |
|
---|
| 111 | <seglistitem>
|
---|
| 112 | <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg>
|
---|
[2cca6fd] | 113 | <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libgcov.a, libgomp.[a,so],
|
---|
[188b6b2] | 114 | libmudflap.[a,so], libmudflapth.[a,so], libssp.[a,so],
|
---|
| 115 | libssp_nonshared.a, libstdc++.[a,so], and libsupc++.a</seg>
|
---|
[61ad0b7f] | 116 | <seg>/usr/include/c++, /usr/lib/gcc</seg>
|
---|
[3f8be484] | 117 | </seglistitem>
|
---|
| 118 | </segmentedlist>
|
---|
| 119 |
|
---|
| 120 | <variablelist>
|
---|
| 121 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 122 | <?dbfo list-presentation="list"?>
|
---|
| 123 | <?dbhtml list-presentation="table"?>
|
---|
| 124 |
|
---|
| 125 | <varlistentry id="cc">
|
---|
| 126 | <term><command>cc</command></term>
|
---|
| 127 | <listitem>
|
---|
| 128 | <para>The C compiler</para>
|
---|
| 129 | <indexterm zone="ch-system-gcc cc">
|
---|
| 130 | <primary sortas="b-cc">cc</primary>
|
---|
| 131 | </indexterm>
|
---|
| 132 | </listitem>
|
---|
| 133 | </varlistentry>
|
---|
| 134 |
|
---|
| 135 | <varlistentry id="cpp">
|
---|
| 136 | <term><command>cpp</command></term>
|
---|
| 137 | <listitem>
|
---|
| 138 | <para>The C preprocessor; it is used by the compiler to expand the
|
---|
| 139 | #include, #define, and similar statements in the source files</para>
|
---|
| 140 | <indexterm zone="ch-system-gcc cpp">
|
---|
| 141 | <primary sortas="b-cpp">cpp</primary>
|
---|
| 142 | </indexterm>
|
---|
| 143 | </listitem>
|
---|
| 144 | </varlistentry>
|
---|
| 145 |
|
---|
| 146 | <varlistentry id="c">
|
---|
| 147 | <term><command>c++</command></term>
|
---|
| 148 | <listitem>
|
---|
| 149 | <para>The C++ compiler</para>
|
---|
| 150 | <indexterm zone="ch-system-gcc c">
|
---|
| 151 | <primary sortas="b-c++">c++</primary>
|
---|
| 152 | </indexterm>
|
---|
| 153 | </listitem>
|
---|
| 154 | </varlistentry>
|
---|
| 155 |
|
---|
| 156 | <varlistentry id="g">
|
---|
| 157 | <term><command>g++</command></term>
|
---|
| 158 | <listitem>
|
---|
| 159 | <para>The C++ compiler</para>
|
---|
| 160 | <indexterm zone="ch-system-gcc g">
|
---|
| 161 | <primary sortas="b-g++">g++</primary>
|
---|
| 162 | </indexterm>
|
---|
| 163 | </listitem>
|
---|
| 164 | </varlistentry>
|
---|
| 165 |
|
---|
| 166 | <varlistentry id="gcc">
|
---|
| 167 | <term><command>gcc</command></term>
|
---|
| 168 | <listitem>
|
---|
| 169 | <para>The C compiler</para>
|
---|
| 170 | <indexterm zone="ch-system-gcc gcc">
|
---|
| 171 | <primary sortas="b-gcc">gcc</primary>
|
---|
| 172 | </indexterm>
|
---|
| 173 | </listitem>
|
---|
| 174 | </varlistentry>
|
---|
| 175 |
|
---|
| 176 | <varlistentry id="gccbug">
|
---|
| 177 | <term><command>gccbug</command></term>
|
---|
| 178 | <listitem>
|
---|
| 179 | <para>A shell script used to help create useful bug reports</para>
|
---|
| 180 | <indexterm zone="ch-system-gcc gccbug">
|
---|
| 181 | <primary sortas="b-gccbug">gccbug</primary>
|
---|
| 182 | </indexterm>
|
---|
| 183 | </listitem>
|
---|
| 184 | </varlistentry>
|
---|
| 185 |
|
---|
| 186 | <varlistentry id="gcov">
|
---|
| 187 | <term><command>gcov</command></term>
|
---|
| 188 | <listitem>
|
---|
| 189 | <para>A coverage testing tool; it is used to analyze programs to
|
---|
| 190 | determine where optimizations will have the most effect</para>
|
---|
| 191 | <indexterm zone="ch-system-gcc gcov">
|
---|
| 192 | <primary sortas="b-gcov">gcov</primary>
|
---|
| 193 | </indexterm>
|
---|
| 194 | </listitem>
|
---|
| 195 | </varlistentry>
|
---|
| 196 |
|
---|
| 197 | <varlistentry id="libgcc">
|
---|
| 198 | <term><filename class="libraryfile">libgcc</filename></term>
|
---|
| 199 | <listitem>
|
---|
| 200 | <para>Contains run-time support for <command>gcc</command></para>
|
---|
| 201 | <indexterm zone="ch-system-gcc libgcc">
|
---|
| 202 | <primary sortas="c-libgcc*">libgcc*</primary>
|
---|
| 203 | </indexterm>
|
---|
| 204 | </listitem>
|
---|
| 205 | </varlistentry>
|
---|
| 206 |
|
---|
[2cca6fd] | 207 | <varlistentry id="libgcov">
|
---|
| 208 | <term><filename class="libraryfile">libgcov</filename></term>
|
---|
| 209 | <listitem>
|
---|
| 210 | <para>Library that is linked into a program when
|
---|
| 211 | <command>gcc</command> is instructed to enable profiling</para>
|
---|
| 212 | <indexterm zone="ch-system-gcc libgcov">
|
---|
| 213 | <primary sortas="c-libgcov">libgcov</primary>
|
---|
| 214 | </indexterm>
|
---|
| 215 | </listitem>
|
---|
| 216 | </varlistentry>
|
---|
| 217 |
|
---|
[188b6b2] | 218 | <varlistentry id="libgomp">
|
---|
| 219 | <term><filename class="libraryfile">libgomp</filename></term>
|
---|
| 220 | <listitem>
|
---|
| 221 | <para>GNU implementation of the OpenMP API for multi-platform
|
---|
| 222 | shared-memory parallel programming in C/C++ and Fortran</para>
|
---|
| 223 | <indexterm zone="ch-system-gcc libgomp">
|
---|
| 224 | <primary sortas="c-libgomp">libgomp</primary>
|
---|
| 225 | </indexterm>
|
---|
| 226 | </listitem>
|
---|
| 227 | </varlistentry>
|
---|
| 228 |
|
---|
[12a457e] | 229 | <varlistentry id="libmudflap">
|
---|
| 230 | <term><filename class="libraryfile">libmudflap</filename></term>
|
---|
| 231 | <listitem>
|
---|
| 232 | <para>The libmudflap libraries are used by GCC for instrumenting
|
---|
[3bec8f3] | 233 | pointer and array dereferencing operations.</para>
|
---|
[12a457e] | 234 | <indexterm zone="ch-system-gcc libmudflap">
|
---|
| 235 | <primary sortas="c-libmudflap*">libmudflap*</primary>
|
---|
| 236 | </indexterm>
|
---|
| 237 | </listitem>
|
---|
| 238 | </varlistentry>
|
---|
| 239 |
|
---|
[188b6b2] | 240 | <varlistentry id="libssp">
|
---|
| 241 | <term><filename class="libraryfile">libssp</filename></term>
|
---|
| 242 | <listitem>
|
---|
| 243 | <para>Contains routines supporting GCC's stack-smashing protection
|
---|
| 244 | functionality</para>
|
---|
| 245 | <indexterm zone="ch-system-gcc libssp">
|
---|
| 246 | <primary sortas="c-libssp*">libssp*</primary>
|
---|
| 247 | </indexterm>
|
---|
| 248 | </listitem>
|
---|
| 249 | </varlistentry>
|
---|
| 250 |
|
---|
[3f8be484] | 251 | <varlistentry id="libstdc">
|
---|
| 252 | <term><filename class="libraryfile">libstdc++</filename></term>
|
---|
| 253 | <listitem>
|
---|
| 254 | <para>The standard C++ library</para>
|
---|
| 255 | <indexterm zone="ch-system-gcc libstdc">
|
---|
| 256 | <primary sortas="c-libstdc++">libstdc++</primary>
|
---|
| 257 | </indexterm>
|
---|
| 258 | </listitem>
|
---|
| 259 | </varlistentry>
|
---|
| 260 |
|
---|
| 261 | <varlistentry id="libsupc">
|
---|
| 262 | <term><filename class="libraryfile">libsupc++</filename></term>
|
---|
| 263 | <listitem>
|
---|
| 264 | <para>Provides supporting routines for the C++ programming
|
---|
| 265 | language</para>
|
---|
| 266 | <indexterm zone="ch-system-gcc libsupc">
|
---|
| 267 | <primary sortas="c-libsupc++">libsupc++</primary>
|
---|
| 268 | </indexterm>
|
---|
| 269 | </listitem>
|
---|
| 270 | </varlistentry>
|
---|
| 271 |
|
---|
| 272 | </variablelist>
|
---|
| 273 |
|
---|
| 274 | </sect2>
|
---|
| 275 |
|
---|
| 276 | </sect1>
|
---|