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