| [bf8c11f] | 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 | <!ENTITY % patches-entities SYSTEM "../../patches.ent"> | 
|---|
|  | 6 | %general-entities; | 
|---|
|  | 7 | %patches-entities; | 
|---|
|  | 8 | ]> | 
|---|
|  | 9 |  | 
|---|
|  | 10 | <sect1 id="ch-system-gcc" role="wrap"> | 
|---|
|  | 11 | <?dbhtml filename="gcc.html"?> | 
|---|
|  | 12 |  | 
|---|
|  | 13 | <title>GCC-&gcc-version;</title> | 
|---|
|  | 14 |  | 
|---|
|  | 15 | <indexterm zone="ch-system-gcc"> | 
|---|
|  | 16 | <primary sortas="a-GCC">GCC</primary> | 
|---|
|  | 17 | </indexterm> | 
|---|
|  | 18 |  | 
|---|
|  | 19 | <sect2 role="package"> | 
|---|
|  | 20 | <title/> | 
|---|
|  | 21 |  | 
|---|
|  | 22 | <para>The GCC package contains the GNU compiler collection, which includes | 
|---|
|  | 23 | the C and C++ compilers.</para> | 
|---|
|  | 24 |  | 
|---|
|  | 25 | <segmentedlist> | 
|---|
|  | 26 | <segtitle>&buildtime;</segtitle> | 
|---|
|  | 27 | <segtitle>&diskspace;</segtitle> | 
|---|
|  | 28 |  | 
|---|
|  | 29 | <seglistitem> | 
|---|
|  | 30 | <seg>Not checked yet</seg> | 
|---|
|  | 31 | <seg>Not checked yet</seg> | 
|---|
|  | 32 | </seglistitem> | 
|---|
|  | 33 | </segmentedlist> | 
|---|
|  | 34 |  | 
|---|
|  | 35 | <segmentedlist> | 
|---|
|  | 36 | <segtitle>&dependencies;</segtitle> | 
|---|
|  | 37 |  | 
|---|
|  | 38 | <seglistitem> | 
|---|
|  | 39 | <seg>Bash, Binutils, Coreutils, Diffutils, Findutils, | 
|---|
|  | 40 | Gawk, Gettext, Glibc, Grep, Make, Perl, Sed, and Texinfo</seg> | 
|---|
|  | 41 | </seglistitem> | 
|---|
|  | 42 | </segmentedlist> | 
|---|
|  | 43 |  | 
|---|
|  | 44 | </sect2> | 
|---|
|  | 45 |  | 
|---|
|  | 46 | <sect2 role="installation"> | 
|---|
|  | 47 | <title>Installation of GCC</title> | 
|---|
|  | 48 |  | 
|---|
|  | 49 | <para os="d">Apply a <command>sed</command> substitution that will suppress the | 
|---|
|  | 50 | installation of <filename class="libraryfile">libiberty.a</filename>. The | 
|---|
|  | 51 | version of <filename class="libraryfile">libiberty.a</filename> provided by | 
|---|
|  | 52 | Binutils will be used instead:</para> | 
|---|
|  | 53 |  | 
|---|
|  | 54 | <screen os="e"><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen> | 
|---|
|  | 55 |  | 
|---|
|  | 56 | <para os="f">The GCC documentation recommends building GCC outside of the source | 
|---|
|  | 57 | directory in a dedicated build directory:</para> | 
|---|
|  | 58 |  | 
|---|
|  | 59 | <screen os="g"><userinput>mkdir ../gcc-build | 
|---|
|  | 60 | cd ../gcc-build</userinput></screen> | 
|---|
|  | 61 |  | 
|---|
|  | 62 | <para os="h">Prepare GCC for compilation:</para> | 
|---|
|  | 63 |  | 
|---|
|  | 64 | <screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \ | 
|---|
|  | 65 | --libexecdir=/usr/lib --enable-shared --enable-threads=posix \ | 
|---|
|  | 66 | --enable-__cxa_atexit --enable-c99 --enable-long-long \ | 
|---|
|  | 67 | --enable-clocale=gnu --enable-languages=c,c++ --disable-libstdcxx-pch</userinput></screen> | 
|---|
|  | 68 |  | 
|---|
|  | 69 | <para os="i">Compile the package:</para> | 
|---|
|  | 70 |  | 
|---|
|  | 71 | <screen os="j"><userinput>make</userinput></screen> | 
|---|
|  | 72 |  | 
|---|
|  | 73 | <important os="k"> | 
|---|
|  | 74 | <para>In this section, the test suite for GCC is considered | 
|---|
|  | 75 | critical. Do not skip it under any circumstance.</para> | 
|---|
|  | 76 | </important> | 
|---|
|  | 77 |  | 
|---|
|  | 78 | <para os="l">Test the results, but do not stop at errors:</para> | 
|---|
|  | 79 |  | 
|---|
|  | 80 | <screen os="m"><userinput>make -k check</userinput></screen> | 
|---|
|  | 81 |  | 
|---|
|  | 82 | <para os="n">The <parameter>-k</parameter> flag is used to make the test suite | 
|---|
|  | 83 | run through to completion and not stop at the first failure. The GCC test | 
|---|
|  | 84 | suite is very comprehensive and is almost guaranteed to generate a few | 
|---|
|  | 85 | failures. To receive a summary of the test suite results, run:</para> | 
|---|
|  | 86 |  | 
|---|
|  | 87 | <screen os="o"><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen> | 
|---|
|  | 88 |  | 
|---|
|  | 89 | <para os="p">For only the summaries, pipe the output through | 
|---|
|  | 90 | <userinput>grep -A7 Summ</userinput>.</para> | 
|---|
|  | 91 |  | 
|---|
|  | 92 | <para os="q">Results can be compared with those located at <ulink | 
|---|
|  | 93 | url="&test-results;"/>.</para> | 
|---|
|  | 94 |  | 
|---|
|  | 95 | <para os="r">A few unexpected failures cannot always be avoided. The | 
|---|
|  | 96 | GCC developers are usually aware of these issues, but have not | 
|---|
|  | 97 | resolved them yet. Unless the test results are vastly different from | 
|---|
|  | 98 | those at the above URL, it is safe to continue.</para> | 
|---|
|  | 99 |  | 
|---|
|  | 100 | <para os="s">Install the package:</para> | 
|---|
|  | 101 |  | 
|---|
|  | 102 | <screen os="t"><userinput>make install</userinput></screen> | 
|---|
|  | 103 |  | 
|---|
|  | 104 | <para os="u">Some packages expect the C preprocessor to be installed in the | 
|---|
|  | 105 | <filename class="directory">/lib</filename> directory. | 
|---|
|  | 106 | To support those packages, create this symlink:</para> | 
|---|
|  | 107 |  | 
|---|
|  | 108 | <screen os="v"><userinput>ln -s ../usr/bin/cpp /lib</userinput></screen> | 
|---|
|  | 109 |  | 
|---|
|  | 110 | <para os="w">Many packages use the name <command>cc</command> to call the C | 
|---|
|  | 111 | compiler. To satisfy those packages, create a symlink:</para> | 
|---|
|  | 112 |  | 
|---|
|  | 113 | <screen os="x"><userinput>ln -s gcc /usr/bin/cc</userinput></screen> | 
|---|
|  | 114 |  | 
|---|
|  | 115 | </sect2> | 
|---|
|  | 116 |  | 
|---|
|  | 117 | <sect2 id="contents-gcc" role="content"> | 
|---|
|  | 118 | <title>Contents of GCC</title> | 
|---|
|  | 119 |  | 
|---|
|  | 120 | <segmentedlist> | 
|---|
|  | 121 | <segtitle>Installed programs</segtitle> | 
|---|
|  | 122 | <segtitle>Installed libraries</segtitle> | 
|---|
|  | 123 |  | 
|---|
|  | 124 | <seglistitem> | 
|---|
|  | 125 | <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg> | 
|---|
|  | 126 | <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libstdc++.[a,so], and | 
|---|
|  | 127 | libsupc++.a</seg> | 
|---|
|  | 128 | </seglistitem> | 
|---|
|  | 129 | </segmentedlist> | 
|---|
|  | 130 |  | 
|---|
|  | 131 | <variablelist> | 
|---|
|  | 132 | <bridgehead renderas="sect3">Short Descriptions</bridgehead> | 
|---|
|  | 133 | <?dbfo list-presentation="list"?> | 
|---|
|  | 134 | <?dbhtml list-presentation="table"?> | 
|---|
|  | 135 |  | 
|---|
|  | 136 | <varlistentry id="cc"> | 
|---|
|  | 137 | <term><command>cc</command></term> | 
|---|
|  | 138 | <listitem> | 
|---|
|  | 139 | <para>The C compiler</para> | 
|---|
|  | 140 | <indexterm zone="ch-system-gcc cc"> | 
|---|
|  | 141 | <primary sortas="b-cc">cc</primary> | 
|---|
|  | 142 | </indexterm> | 
|---|
|  | 143 | </listitem> | 
|---|
|  | 144 | </varlistentry> | 
|---|
|  | 145 |  | 
|---|
|  | 146 | <varlistentry id="cpp"> | 
|---|
|  | 147 | <term><command>cpp</command></term> | 
|---|
|  | 148 | <listitem> | 
|---|
|  | 149 | <para>The C preprocessor; it is used by the compiler to expand the | 
|---|
|  | 150 | #include, #define, and similar statements in the source files</para> | 
|---|
|  | 151 | <indexterm zone="ch-system-gcc cpp"> | 
|---|
|  | 152 | <primary sortas="b-cpp">cpp</primary> | 
|---|
|  | 153 | </indexterm> | 
|---|
|  | 154 | </listitem> | 
|---|
|  | 155 | </varlistentry> | 
|---|
|  | 156 |  | 
|---|
|  | 157 | <varlistentry id="c"> | 
|---|
|  | 158 | <term><command>c++</command></term> | 
|---|
|  | 159 | <listitem> | 
|---|
|  | 160 | <para>The C++ compiler</para> | 
|---|
|  | 161 | <indexterm zone="ch-system-gcc c"> | 
|---|
|  | 162 | <primary sortas="b-c++">c++</primary> | 
|---|
|  | 163 | </indexterm> | 
|---|
|  | 164 | </listitem> | 
|---|
|  | 165 | </varlistentry> | 
|---|
|  | 166 |  | 
|---|
|  | 167 | <varlistentry id="g"> | 
|---|
|  | 168 | <term><command>g++</command></term> | 
|---|
|  | 169 | <listitem> | 
|---|
|  | 170 | <para>The C++ compiler</para> | 
|---|
|  | 171 | <indexterm zone="ch-system-gcc g"> | 
|---|
|  | 172 | <primary sortas="b-g++">g++</primary> | 
|---|
|  | 173 | </indexterm> | 
|---|
|  | 174 | </listitem> | 
|---|
|  | 175 | </varlistentry> | 
|---|
|  | 176 |  | 
|---|
|  | 177 | <varlistentry id="gcc"> | 
|---|
|  | 178 | <term><command>gcc</command></term> | 
|---|
|  | 179 | <listitem> | 
|---|
|  | 180 | <para>The C compiler</para> | 
|---|
|  | 181 | <indexterm zone="ch-system-gcc gcc"> | 
|---|
|  | 182 | <primary sortas="b-gcc">gcc</primary> | 
|---|
|  | 183 | </indexterm> | 
|---|
|  | 184 | </listitem> | 
|---|
|  | 185 | </varlistentry> | 
|---|
|  | 186 |  | 
|---|
|  | 187 | <varlistentry id="gccbug"> | 
|---|
|  | 188 | <term><command>gccbug</command></term> | 
|---|
|  | 189 | <listitem> | 
|---|
|  | 190 | <para>A shell script used to help create useful bug reports</para> | 
|---|
|  | 191 | <indexterm zone="ch-system-gcc gccbug"> | 
|---|
|  | 192 | <primary sortas="b-gccbug">gccbug</primary> | 
|---|
|  | 193 | </indexterm> | 
|---|
|  | 194 | </listitem> | 
|---|
|  | 195 | </varlistentry> | 
|---|
|  | 196 |  | 
|---|
|  | 197 | <varlistentry id="gcov"> | 
|---|
|  | 198 | <term><command>gcov</command></term> | 
|---|
|  | 199 | <listitem> | 
|---|
|  | 200 | <para>A coverage testing tool; it is used to analyze programs to | 
|---|
|  | 201 | determine where optimizations will have the most effect</para> | 
|---|
|  | 202 | <indexterm zone="ch-system-gcc gcov"> | 
|---|
|  | 203 | <primary sortas="b-gcov">gcov</primary> | 
|---|
|  | 204 | </indexterm> | 
|---|
|  | 205 | </listitem> | 
|---|
|  | 206 | </varlistentry> | 
|---|
|  | 207 |  | 
|---|
|  | 208 | <varlistentry id="libgcc"> | 
|---|
|  | 209 | <term><filename class="libraryfile">libgcc</filename></term> | 
|---|
|  | 210 | <listitem> | 
|---|
|  | 211 | <para>Contains run-time support for <command>gcc</command></para> | 
|---|
|  | 212 | <indexterm zone="ch-system-gcc libgcc"> | 
|---|
|  | 213 | <primary sortas="c-libgcc*">libgcc*</primary> | 
|---|
|  | 214 | </indexterm> | 
|---|
|  | 215 | </listitem> | 
|---|
|  | 216 | </varlistentry> | 
|---|
|  | 217 |  | 
|---|
|  | 218 | <varlistentry id="libstdc"> | 
|---|
|  | 219 | <term><filename class="libraryfile">libstdc++</filename></term> | 
|---|
|  | 220 | <listitem> | 
|---|
|  | 221 | <para>The standard C++ library</para> | 
|---|
|  | 222 | <indexterm zone="ch-system-gcc libstdc"> | 
|---|
|  | 223 | <primary sortas="c-libstdc++">libstdc++</primary> | 
|---|
|  | 224 | </indexterm> | 
|---|
|  | 225 | </listitem> | 
|---|
|  | 226 | </varlistentry> | 
|---|
|  | 227 |  | 
|---|
|  | 228 | <varlistentry id="libsupc"> | 
|---|
|  | 229 | <term><filename class="libraryfile">libsupc++</filename></term> | 
|---|
|  | 230 | <listitem> | 
|---|
|  | 231 | <para>Provides supporting routines for the C++ programming | 
|---|
|  | 232 | language</para> | 
|---|
|  | 233 | <indexterm zone="ch-system-gcc libsupc"> | 
|---|
|  | 234 | <primary sortas="c-libsupc++">libsupc++</primary> | 
|---|
|  | 235 | </indexterm> | 
|---|
|  | 236 | </listitem> | 
|---|
|  | 237 | </varlistentry> | 
|---|
|  | 238 |  | 
|---|
|  | 239 | </variablelist> | 
|---|
|  | 240 |  | 
|---|
|  | 241 | </sect2> | 
|---|
|  | 242 |  | 
|---|
|  | 243 | </sect1> | 
|---|