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