[02095ae] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[c439b8a] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[02095ae] | 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 |
|
---|
[7126617] | 28 | <para os="p1">To make sure that a couple of tools use the proper syntax,
|
---|
| 29 | apply the following patch:</para>
|
---|
| 30 |
|
---|
[5ec080e] | 31 | <screen os="p2"><userinput>patch -Np1 -i ../&gcc-posix-patch;</userinput></screen>
|
---|
[7126617] | 32 |
|
---|
[02095ae] | 33 | <para os="a">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 |
|
---|
[7126617] | 38 | <screen os="b"><userinput>cp libiberty/Makefile.in{,.orig}
|
---|
[a074923] | 39 | sed 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in.orig > \
|
---|
| 40 | libiberty/Makefile.in</userinput></screen>
|
---|
[02095ae] | 41 |
|
---|
| 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.
|
---|
| 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>
|
---|
| 47 |
|
---|
[7126617] | 48 | <screen os="e2"><userinput>cp gcc/gccbug.in{,.orig}
|
---|
| 49 | sed 's/@have_mktemp_command@/yes/' gcc/gccbug.in.orig > gcc/gccbug.in</userinput></screen>
|
---|
[02095ae] | 50 |
|
---|
[c0cd0ca] | 51 | <para os="s1">The fixincludes attempts to "fix" the system headers
|
---|
| 52 | installed so far. Since gcc is cross-compiled expecting the system
|
---|
| 53 | headers to be in <filename class="directory">/usr/include</filename>
|
---|
| 54 | the script will be looking at host headers. The following sed prevents
|
---|
| 55 | the fixincludes script from running:</para>
|
---|
| 56 |
|
---|
| 57 | <screen os="s2"><userinput>cp gcc/Makefile.in{,.orig}
|
---|
| 58 | sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in</userinput></screen>
|
---|
| 59 |
|
---|
[02095ae] | 60 | <para os="c">The GCC documentation recommends building GCC outside of the source
|
---|
| 61 | directory in a dedicated build directory:</para>
|
---|
| 62 |
|
---|
| 63 | <screen os="d"><userinput>mkdir -v ../gcc-build
|
---|
| 64 | cd ../gcc-build</userinput></screen>
|
---|
| 65 |
|
---|
| 66 | <para os="e">Prepare GCC for compilation:</para>
|
---|
| 67 |
|
---|
[7126617] | 68 | <screen os="f"><userinput>../gcc-&gcc-version;/configure --prefix=/usr --libexecdir=/usr/lib \
|
---|
[586feb7] | 69 | --build=${CLFS_HOST} --host=${CLFS_TARGET} --target=${CLFS_TARGET} \
|
---|
[02095ae] | 70 | --enable-shared --enable-threads=posix --enable-__cxa_atexit \
|
---|
| 71 | --enable-c99 --enable-long-long --enable-clocale=gnu \
|
---|
| 72 | --enable-languages=c,c++ --disable-libstdcxx-pch</userinput></screen>
|
---|
| 73 |
|
---|
| 74 | <para os="g">Compile the package:</para>
|
---|
| 75 |
|
---|
| 76 | <screen os="h"><userinput>make</userinput></screen>
|
---|
| 77 |
|
---|
| 78 | <para os="i">Install the package:</para>
|
---|
| 79 |
|
---|
[586feb7] | 80 | <screen os="j"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
|
---|
[02095ae] | 81 |
|
---|
| 82 | <para os="k">Some packages expect the C preprocessor to be installed in the
|
---|
| 83 | <filename class="directory">/lib</filename> directory.
|
---|
| 84 | To support those packages, create this symlink:</para>
|
---|
| 85 |
|
---|
[7e336f1] | 86 | <screen os="l"><userinput>ln -sfv ../usr/bin/cpp ${CLFS}/lib</userinput></screen>
|
---|
[02095ae] | 87 |
|
---|
| 88 | <para os="m">Many packages use the name <command>cc</command> to call the C
|
---|
| 89 | compiler. To satisfy those packages, create a symlink:</para>
|
---|
| 90 |
|
---|
[7e336f1] | 91 | <screen os="o"><userinput>ln -sfv gcc ${CLFS}/usr/bin/cc</userinput></screen>
|
---|
[02095ae] | 92 |
|
---|
| 93 | </sect2>
|
---|
| 94 |
|
---|
| 95 | <sect2 id="contents-gcc" role="content">
|
---|
| 96 | <title>Contents of GCC</title>
|
---|
| 97 |
|
---|
| 98 | <segmentedlist>
|
---|
| 99 | <segtitle>Installed programs</segtitle>
|
---|
| 100 | <segtitle>Installed libraries</segtitle>
|
---|
| 101 |
|
---|
| 102 | <seglistitem>
|
---|
| 103 | <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg>
|
---|
[c213baf] | 104 | <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libgomp.[a,so], libmudflap.[a,so],
|
---|
| 105 | libmudflapth.[a,so], libssp.[a,so], libstdc++.[a,so], and
|
---|
[02095ae] | 106 | libsupc++.a</seg>
|
---|
| 107 | </seglistitem>
|
---|
| 108 | </segmentedlist>
|
---|
| 109 |
|
---|
| 110 | <variablelist>
|
---|
| 111 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 112 | <?dbfo list-presentation="list"?>
|
---|
| 113 | <?dbhtml list-presentation="table"?>
|
---|
| 114 |
|
---|
| 115 | <varlistentry id="cc">
|
---|
| 116 | <term><command>cc</command></term>
|
---|
| 117 | <listitem>
|
---|
| 118 | <para>The C compiler</para>
|
---|
| 119 | <indexterm zone="ch-system-gcc cc">
|
---|
| 120 | <primary sortas="b-cc">cc</primary>
|
---|
| 121 | </indexterm>
|
---|
| 122 | </listitem>
|
---|
| 123 | </varlistentry>
|
---|
| 124 |
|
---|
| 125 | <varlistentry id="cpp">
|
---|
| 126 | <term><command>cpp</command></term>
|
---|
| 127 | <listitem>
|
---|
| 128 | <para>The C preprocessor; it is used by the compiler to expand the
|
---|
| 129 | #include, #define, and similar statements in the source files</para>
|
---|
| 130 | <indexterm zone="ch-system-gcc cpp">
|
---|
| 131 | <primary sortas="b-cpp">cpp</primary>
|
---|
| 132 | </indexterm>
|
---|
| 133 | </listitem>
|
---|
| 134 | </varlistentry>
|
---|
| 135 |
|
---|
| 136 | <varlistentry id="c">
|
---|
| 137 | <term><command>c++</command></term>
|
---|
| 138 | <listitem>
|
---|
| 139 | <para>The C++ compiler</para>
|
---|
| 140 | <indexterm zone="ch-system-gcc c">
|
---|
| 141 | <primary sortas="b-c++">c++</primary>
|
---|
| 142 | </indexterm>
|
---|
| 143 | </listitem>
|
---|
| 144 | </varlistentry>
|
---|
| 145 |
|
---|
| 146 | <varlistentry id="g">
|
---|
| 147 | <term><command>g++</command></term>
|
---|
| 148 | <listitem>
|
---|
| 149 | <para>The C++ compiler</para>
|
---|
| 150 | <indexterm zone="ch-system-gcc g">
|
---|
| 151 | <primary sortas="b-g++">g++</primary>
|
---|
| 152 | </indexterm>
|
---|
| 153 | </listitem>
|
---|
| 154 | </varlistentry>
|
---|
| 155 |
|
---|
| 156 | <varlistentry id="gcc">
|
---|
| 157 | <term><command>gcc</command></term>
|
---|
| 158 | <listitem>
|
---|
| 159 | <para>The C compiler</para>
|
---|
| 160 | <indexterm zone="ch-system-gcc gcc">
|
---|
| 161 | <primary sortas="b-gcc">gcc</primary>
|
---|
| 162 | </indexterm>
|
---|
| 163 | </listitem>
|
---|
| 164 | </varlistentry>
|
---|
| 165 |
|
---|
| 166 | <varlistentry id="gccbug">
|
---|
| 167 | <term><command>gccbug</command></term>
|
---|
| 168 | <listitem>
|
---|
| 169 | <para>A shell script used to help create useful bug reports</para>
|
---|
| 170 | <indexterm zone="ch-system-gcc gccbug">
|
---|
| 171 | <primary sortas="b-gccbug">gccbug</primary>
|
---|
| 172 | </indexterm>
|
---|
| 173 | </listitem>
|
---|
| 174 | </varlistentry>
|
---|
| 175 |
|
---|
| 176 | <varlistentry id="gcov">
|
---|
| 177 | <term><command>gcov</command></term>
|
---|
| 178 | <listitem>
|
---|
| 179 | <para>A coverage testing tool; it is used to analyze programs to
|
---|
| 180 | determine where optimizations will have the most effect</para>
|
---|
| 181 | <indexterm zone="ch-system-gcc gcov">
|
---|
| 182 | <primary sortas="b-gcov">gcov</primary>
|
---|
| 183 | </indexterm>
|
---|
| 184 | </listitem>
|
---|
| 185 | </varlistentry>
|
---|
| 186 |
|
---|
| 187 | <varlistentry id="libgcc">
|
---|
| 188 | <term><filename class="libraryfile">libgcc</filename></term>
|
---|
| 189 | <listitem>
|
---|
| 190 | <para>Contains run-time support for <command>gcc</command></para>
|
---|
| 191 | <indexterm zone="ch-system-gcc libgcc">
|
---|
| 192 | <primary sortas="c-libgcc*">libgcc*</primary>
|
---|
| 193 | </indexterm>
|
---|
| 194 | </listitem>
|
---|
| 195 | </varlistentry>
|
---|
| 196 |
|
---|
| 197 | <varlistentry id="libmudflap">
|
---|
| 198 | <term><filename class="libraryfile">libmudflap</filename></term>
|
---|
| 199 | <listitem>
|
---|
| 200 | <para>The libmudflap libraries are used by GCC for instrumenting
|
---|
| 201 | pointer and array dereferencing operations.</para>
|
---|
| 202 | <indexterm zone="ch-system-gcc libmudflap">
|
---|
| 203 | <primary sortas="c-libmudflap*">libmudflap*</primary>
|
---|
| 204 | </indexterm>
|
---|
| 205 | </listitem>
|
---|
| 206 | </varlistentry>
|
---|
| 207 |
|
---|
| 208 | <varlistentry id="libstdc">
|
---|
| 209 | <term><filename class="libraryfile">libstdc++</filename></term>
|
---|
| 210 | <listitem>
|
---|
| 211 | <para>The standard C++ library</para>
|
---|
| 212 | <indexterm zone="ch-system-gcc libstdc">
|
---|
| 213 | <primary sortas="c-libstdc++">libstdc++</primary>
|
---|
| 214 | </indexterm>
|
---|
| 215 | </listitem>
|
---|
| 216 | </varlistentry>
|
---|
| 217 |
|
---|
| 218 | <varlistentry id="libsupc">
|
---|
| 219 | <term><filename class="libraryfile">libsupc++</filename></term>
|
---|
| 220 | <listitem>
|
---|
| 221 | <para>Provides supporting routines for the C++ programming
|
---|
| 222 | language</para>
|
---|
| 223 | <indexterm zone="ch-system-gcc libsupc">
|
---|
| 224 | <primary sortas="c-libsupc++">libsupc++</primary>
|
---|
| 225 | </indexterm>
|
---|
| 226 | </listitem>
|
---|
| 227 | </varlistentry>
|
---|
| 228 |
|
---|
| 229 | </variablelist>
|
---|
| 230 |
|
---|
| 231 | </sect2>
|
---|
| 232 |
|
---|
| 233 | </sect1>
|
---|