1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY gcc-download-http "http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
|
---|
8 | <!ENTITY gcc-download-ftp "ftp://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
|
---|
9 | <!ENTITY gcc-size "27.2 MB">
|
---|
10 | <!ENTITY gcc-buildsize "1.53 GB">
|
---|
11 | <!ENTITY gcc-time "48.94 SBU">
|
---|
12 |
|
---|
13 | <!ENTITY gnat-download-http " ">
|
---|
14 | <!ENTITY gnat-download-ftp "ftp://cs.nyu.edu/pub/gnat/3.15p/gnat-3.15p-i686-pc-redhat71-gnu-bin.tar.gz">
|
---|
15 | <!ENTITY gnat-size "13.5 MB">
|
---|
16 | <!ENTITY gnat-buildsize "48 MB">
|
---|
17 | <!ENTITY gnat-time "0.01 SBU">
|
---|
18 | ]>
|
---|
19 |
|
---|
20 | <sect1 id="gcc" xreflabel="GCC-&gcc-version;">
|
---|
21 | <sect1info>
|
---|
22 | <othername>$LastChangedBy$</othername>
|
---|
23 | <date>$Date$</date>
|
---|
24 | </sect1info>
|
---|
25 | <?dbhtml filename="gcc.html" ?>
|
---|
26 | <title>GCC-&gcc-version;</title>
|
---|
27 |
|
---|
28 | <sect2>
|
---|
29 | <title>Introduction to <application><acronym>GCC</acronym></application></title>
|
---|
30 |
|
---|
31 | <para>The <application><acronym>GCC</acronym></application> package contains
|
---|
32 | <acronym>GNU</acronym> compilers. This is useful for compiling programs
|
---|
33 | written in <application>C</application>, <application>C++</application>,
|
---|
34 | <application>Fortran</application>, <application>Java</application>,
|
---|
35 | <application>Objective C</application> and
|
---|
36 | <application>Ada</application>.</para>
|
---|
37 |
|
---|
38 | <sect3><title>Package Information</title>
|
---|
39 | <itemizedlist spacing='compact'>
|
---|
40 | <listitem><para>Download (HTTP): <ulink
|
---|
41 | url="&gcc-download-http;"/></para></listitem>
|
---|
42 | <listitem><para>Download (FTP): <ulink
|
---|
43 | url="&gcc-download-ftp;"/></para></listitem>
|
---|
44 | <listitem><para>Download size: &gcc-size;</para></listitem>
|
---|
45 | <listitem><para>Estimated Disk space required:
|
---|
46 | &gcc-buildsize;</para></listitem>
|
---|
47 | <listitem><para>Estimated build time:
|
---|
48 | &gcc-time;</para></listitem></itemizedlist>
|
---|
49 | </sect3>
|
---|
50 |
|
---|
51 | <sect3><title>Additional Downloads</title>
|
---|
52 | <itemizedlist spacing='compact'>
|
---|
53 | <listitem><para>Required Patch: <ulink
|
---|
54 | url="&patch-root;/gcc-&gcc-version;-no_fixincludes-1.patch"/></para></listitem>
|
---|
55 | <listitem><para>Required Patch: <ulink
|
---|
56 | url="&patch-root;/gcc-&gcc-version;-linkonce-1.patch"/></para></listitem>
|
---|
57 | <listitem><para>Test Suite: <ulink
|
---|
58 | url="http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-&gcc-version;/gcc-testsuite-&gcc-version;.tar.bz2"/></para>
|
---|
59 | </listitem>
|
---|
60 | </itemizedlist></sect3>
|
---|
61 |
|
---|
62 | <sect3><title><application><acronym>GCC</acronym></application>
|
---|
63 | Dependencies</title>
|
---|
64 | <sect4><title>Recommended</title>
|
---|
65 | <itemizedlist spacing='compact'>
|
---|
66 | <listitem><para><xref linkend="dejagnu"/></para></listitem>
|
---|
67 | </itemizedlist>
|
---|
68 | </sect4></sect3>
|
---|
69 |
|
---|
70 | </sect2>
|
---|
71 |
|
---|
72 | <sect2>
|
---|
73 | <title>Installation of <application><acronym>GCC</acronym></application></title>
|
---|
74 |
|
---|
75 | <para>If you plan to compile Ada, you will need to install
|
---|
76 | <application><acronym>GNAT</acronym></application> temporarily to
|
---|
77 | satisfy the circular dependency when you recompile
|
---|
78 | <application><acronym>GCC</acronym></application> to include
|
---|
79 | <application>Ada</application>.</para>
|
---|
80 |
|
---|
81 | <sect3><title>Package information</title>
|
---|
82 | <itemizedlist spacing='compact'>
|
---|
83 | <listitem><para>Download (HTTP): <ulink
|
---|
84 | url="&gnat-download-http;"/></para></listitem>
|
---|
85 | <listitem><para>Download (FTP): <ulink
|
---|
86 | url="&gnat-download-ftp;"/></para></listitem>
|
---|
87 | <listitem><para>Download size: &gnat-size;</para></listitem>
|
---|
88 | <listitem><para>Estimated Disk space required:
|
---|
89 | &gnat-buildsize;</para></listitem>
|
---|
90 | <listitem><para>Estimated build time:
|
---|
91 | &gnat-time;</para></listitem></itemizedlist>
|
---|
92 | </sect3>
|
---|
93 |
|
---|
94 | <sect3><title><application><acronym>GNAT</acronym></application>
|
---|
95 | dependencies</title>
|
---|
96 | <sect4><title>Required</title>
|
---|
97 | <para><xref linkend="tcsh"/></para></sect4>
|
---|
98 | </sect3>
|
---|
99 |
|
---|
100 | </sect2>
|
---|
101 |
|
---|
102 | <sect2>
|
---|
103 | <title>Installation of <application><acronym>GNAT</acronym></application>
|
---|
104 | </title>
|
---|
105 |
|
---|
106 | <para>Install <application><acronym>GNAT</acronym></application> by running the
|
---|
107 | following commands:</para>
|
---|
108 |
|
---|
109 | <screen><userinput><command>./doconfig</command></userinput></screen>
|
---|
110 |
|
---|
111 | <para>The above script will ask you how and where you would like to install
|
---|
112 | <application><acronym>GNAT</acronym></application>. To avoid conflicts with the
|
---|
113 | system <command>gcc</command>, the package will be installed in a separate
|
---|
114 | directory, that can later be removed from the system.</para>
|
---|
115 |
|
---|
116 | <para>In response to the questions asked by the <command>doconfig</command>
|
---|
117 | script, enter <userinput>3</userinput> in response to the first question
|
---|
118 | and <userinput>/opt/gnat</userinput> in response to the second question.</para>
|
---|
119 |
|
---|
120 | <para>To finish the install, run:</para>
|
---|
121 | <screen><userinput><command>./doinstall</command></userinput></screen>
|
---|
122 |
|
---|
123 | <para>The <application><acronym>GNAT</acronym></application> compiler can be
|
---|
124 | invoked by executing the <command>gcc</command> binary installed by the above
|
---|
125 | script.</para>
|
---|
126 |
|
---|
127 | <para>Prepare to compile <application>GCC</application> by placing the
|
---|
128 | <application>GNAT</application> <command>gcc</command> at the beginning of
|
---|
129 | the <envar>PATH</envar> variable by using the following commands:</para>
|
---|
130 |
|
---|
131 | <screen><userinput><command>PATH_HOLD=$PATH &&
|
---|
132 | export PATH=/opt/gnat/bin:$PATH</command></userinput></screen>
|
---|
133 |
|
---|
134 | </sect2>
|
---|
135 |
|
---|
136 | <sect2><title>Return to Installation of
|
---|
137 | <application><acronym>GCC</acronym></application></title>
|
---|
138 |
|
---|
139 | <para>Install <application><acronym>GCC</acronym></application> by running the
|
---|
140 | following commands:</para>
|
---|
141 |
|
---|
142 | <important><para>The installation process may overwrite your existing
|
---|
143 | <application><acronym>GCC</acronym></application> compiler and libraries. It
|
---|
144 | is highly recommended that you have the <application>Tcl</application>,
|
---|
145 | <application>Expect</application> and <application>DejaGnu</application>
|
---|
146 | packages installed, as well as unpacking the
|
---|
147 | <application><acronym>GCC</acronym></application> testsuite tarball before
|
---|
148 | beginning the build.</para>
|
---|
149 |
|
---|
150 | <para>Do not continue with the <command>make install</command> command until
|
---|
151 | you're confident the build was successful. You can compare your test results
|
---|
152 | with those found at <ulink
|
---|
153 | url="http://gcc.gnu.org/ml/gcc-testresults/"/>. There's also an i686 platform
|
---|
154 | test result produced by an <acronym>LFS</acronym> (6.0-testing-20041003) system
|
---|
155 | at <ulink url="http://www.linuxfromscratch.org/~randy/gcc341_test.txt"/>. You
|
---|
156 | may also want to refer to the information found in the
|
---|
157 | <application><acronym>GCC</acronym></application>-Pass 2 section of Chapter 5
|
---|
158 | in the <acronym>LFS</acronym> book.</para></important>
|
---|
159 |
|
---|
160 | <note><para>Some of the <application>Java</application> programs installed by
|
---|
161 | the <application><acronym>GCC</acronym></application> package conflict (have
|
---|
162 | the same names) with programs from the <xref linkend="j2sdk"/> package. If
|
---|
163 | you're installing the <application>Java</application> language from the
|
---|
164 | <application><acronym>GCC</acronym></application> package but you wish to
|
---|
165 | use the programs from the <application>JDK</application> as the defaults,
|
---|
166 | ensure
|
---|
167 | <filename class='directory'><replaceable>[JDKpath]</replaceable>/bin</filename>
|
---|
168 | is listed before <filename class='directory'>/usr/bin</filename> in your
|
---|
169 | <envar>PATH</envar> variable.</para></note>
|
---|
170 |
|
---|
171 | <screen><userinput><command>patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes-1.patch &&
|
---|
172 | patch -Np1 -i ../gcc-&gcc-version;-linkonce-1.patch &&
|
---|
173 | sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &&
|
---|
174 | mkdir ../gcc-build &&
|
---|
175 | cd ../gcc-build &&
|
---|
176 | ../gcc-&gcc-version;/configure --prefix=/usr --libexecdir=/usr/lib \
|
---|
177 | --enable-shared --enable-languages=c,c++,objc,f77,ada,java \
|
---|
178 | --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu &&
|
---|
179 | make bootstrap &&
|
---|
180 | make -C gcc gnatlib-shared &&
|
---|
181 | make -C gcc gnattools &&
|
---|
182 | make -k check &&
|
---|
183 | ../gcc-3.4.1/contrib/test_summary &&
|
---|
184 | make install &&
|
---|
185 | ln -sf ../usr/bin/cpp /lib &&
|
---|
186 | ln -sf gcc /usr/bin/cc &&
|
---|
187 | ln -sf g77 /usr/bin/f77 &&
|
---|
188 | chown -R root:root /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include</command></userinput></screen>
|
---|
189 |
|
---|
190 | <para>You may remove the <application><acronym>GNAT</acronym></application>
|
---|
191 | installation and restore your old <envar>PATH</envar>:</para>
|
---|
192 |
|
---|
193 | <screen><userinput><command>rm -rf /opt/gnat &&
|
---|
194 | export PATH=$PATH_HOLD</command></userinput></screen>
|
---|
195 |
|
---|
196 | </sect2>
|
---|
197 |
|
---|
198 | <sect2>
|
---|
199 | <title>Command explanations</title>
|
---|
200 |
|
---|
201 | <para><command>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</command>:
|
---|
202 | This command suppresses the installation of
|
---|
203 | <filename class='libraryfile'>libiberty.a</filename> as the version provided
|
---|
204 | by <application>Binutils</application> is used instead.</para>
|
---|
205 |
|
---|
206 | <para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
|
---|
207 | <application><acronym>GCC</acronym></application> documentation recommends
|
---|
208 | building the package in a dedicated build directory.</para>
|
---|
209 |
|
---|
210 | <para><parameter>--enable-languages=c,c++,objc,f77,ada,java</parameter>:
|
---|
211 | This command identifies which languages to build. You may modify this command
|
---|
212 | to remove undesired languages.</para>
|
---|
213 |
|
---|
214 | <para><parameter>--enable-shared --enable-threads=posix
|
---|
215 | --enable-__cxa_atexit</parameter>: These commands are required to build
|
---|
216 | the <application>C++</application> libraries to published standards.</para>
|
---|
217 |
|
---|
218 | <para><parameter>--enable-clocale=gnu</parameter>: This command is a
|
---|
219 | failsafe for incomplete locale data.</para>
|
---|
220 |
|
---|
221 | <para><command>make -C gcc gnatlib-shared</command>: This command builds the
|
---|
222 | Ada shared and static libraries. Skip this step if you have not enabled
|
---|
223 | <application>Ada</application> as one of the languages.</para>
|
---|
224 |
|
---|
225 | <para><command>make -C gcc gnattools</command>: This command builds the
|
---|
226 | Ada development tools and binaries. Skip this step if you have not enabled
|
---|
227 | <application>Ada</application> as one of the languages.</para>
|
---|
228 |
|
---|
229 | <para><command>make -k check</command>: This command runs the test suite
|
---|
230 | without stopping should any errors be encountered.</para>
|
---|
231 |
|
---|
232 | <para><command>../gcc-3.4.1/contrib/test_summary</command>: This command will
|
---|
233 | produce a summary of the test suite results. You can append
|
---|
234 | <command>| grep -A7 Summ</command> to the command to produce an even more
|
---|
235 | condensed version of the summary. You may also wish to redirect the output to
|
---|
236 | a file for review and comparison later on.</para>
|
---|
237 |
|
---|
238 | <para><command>ln -sf ../usr/bin/cpp /lib</command>: This command creates a
|
---|
239 | link to the C PreProcessor as some packages expect it to be installed in the
|
---|
240 | <filename class='directory'>/lib</filename> directory.</para>
|
---|
241 |
|
---|
242 | <para><command>ln -sf gcc /usr/bin/cc; ln -sf g77 /usr/bin/f77</command>:
|
---|
243 | These links are created as some packages refer to the C and Fortran compilers
|
---|
244 | using an alternate name.</para>
|
---|
245 |
|
---|
246 | <para><command>chown -R root:root /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include</command>:
|
---|
247 | If the package is built by a user other than root, the ownership of the
|
---|
248 | installed <filename class='directory'>include</filename> directory (and its
|
---|
249 | contents) will be incorrect. This command changes the ownership to
|
---|
250 | root:root.</para>
|
---|
251 |
|
---|
252 | </sect2>
|
---|
253 |
|
---|
254 | <sect2>
|
---|
255 | <title>Contents</title>
|
---|
256 |
|
---|
257 | <para>The <application><acronym>GCC</acronym></application> package contains
|
---|
258 | <command>addr2name.awk</command>,
|
---|
259 | <command>c++</command>,
|
---|
260 | <command>cpp</command>,
|
---|
261 | <command>g++</command>,
|
---|
262 | <command>g77</command>,
|
---|
263 | <command>gcc</command>,
|
---|
264 | <command>gccbug</command>,
|
---|
265 | <command>gcj</command>,
|
---|
266 | <command>gcjh</command>,
|
---|
267 | <command>gcov</command>,
|
---|
268 | <command>gij</command>,
|
---|
269 | <command>gnat</command>,
|
---|
270 | <command>gnatbind</command>,
|
---|
271 | <command>gnatbl</command>,
|
---|
272 | <command>gnatchop</command>,
|
---|
273 | <command>gnatclean</command>,
|
---|
274 | <command>gnatfind</command>,
|
---|
275 | <command>gnatkr</command>,
|
---|
276 | <command>gnatlink</command>,
|
---|
277 | <command>gnatls</command>,
|
---|
278 | <command>gnatmake</command>,
|
---|
279 | <command>gnatname</command>,
|
---|
280 | <command>gnatprep</command>,
|
---|
281 | <command>gnatxref</command>,
|
---|
282 | <command>grepjar</command>,
|
---|
283 | <command>jar</command>,
|
---|
284 | <command>jcf-dump</command>,
|
---|
285 | <command>jv-convert</command>,
|
---|
286 | <command>jv-scan</command>,
|
---|
287 | <command>rmic</command>,
|
---|
288 | <command>rmiregistry</command> and
|
---|
289 | <application><acronym>GCC</acronym></application> libraries.</para>
|
---|
290 |
|
---|
291 | </sect2>
|
---|
292 |
|
---|
293 | <sect2><title>Description</title>
|
---|
294 |
|
---|
295 | <para>The programs and libraries whose descriptions are missing here
|
---|
296 | have been described in the <acronym>LFS</acronym>
|
---|
297 | <acronym>GCC</acronym>-&gcc-version; page.</para>
|
---|
298 |
|
---|
299 | <sect3><title>addr2name.awk</title>
|
---|
300 | <para><command>addr2name.awk</command> emulates some of the functionality
|
---|
301 | of addr2line.</para></sect3>
|
---|
302 |
|
---|
303 | <sect3><title>g77</title>
|
---|
304 | <para><command>g77</command> is the <application>Fortran</application> compiler
|
---|
305 | invoked by <command>gcc</command>.</para></sect3>
|
---|
306 |
|
---|
307 | <sect3><title>gcj</title>
|
---|
308 | <para><command>gcj</command> is an ahead-of-time compiler for the
|
---|
309 | <application>Java</application> language.</para></sect3>
|
---|
310 |
|
---|
311 | <sect3><title>gcjh</title>
|
---|
312 | <para><command>gcjh</command> generates header files from
|
---|
313 | <application>Java</application> class files.</para></sect3>
|
---|
314 |
|
---|
315 | <sect3><title>gij</title>
|
---|
316 | <para><command>gij</command> is the <acronym>GNU</acronym> interpreter for
|
---|
317 | <application>Java</application> bytecode.</para></sect3>
|
---|
318 |
|
---|
319 | <sect3><title>gnat</title>
|
---|
320 | <para><command>gnat</command> is the <application>Ada</application> compiler
|
---|
321 | invoked by <command>gcc</command>.</para></sect3>
|
---|
322 |
|
---|
323 | <sect3><title>gnatbind</title>
|
---|
324 | <para><command>gnatbind</command> is used to bind compiled
|
---|
325 | objects.</para></sect3>
|
---|
326 |
|
---|
327 | <sect3><title>gnatbl</title>
|
---|
328 | <para><command>gnatbl</command> is the <application>Ada</application>
|
---|
329 | linker.</para></sect3>
|
---|
330 |
|
---|
331 | <sect3><title>gnatchop</title>
|
---|
332 | <para><command>gnatchop</command> is useful for renaming files to meet the
|
---|
333 | standard <application>Ada</application> default file naming
|
---|
334 | conventions.</para></sect3>
|
---|
335 |
|
---|
336 | <sect3><title>gnatclean</title>
|
---|
337 | <para><command>gnatclean</command> is used to remove files associated with a
|
---|
338 | <application><acronym>GNAT</acronym></application> project.</para></sect3>
|
---|
339 |
|
---|
340 | <sect3><title>gnatfind</title>
|
---|
341 | <para><command>gnatfind</command> is the
|
---|
342 | <application><acronym>GNAT</acronym></application> definition/use
|
---|
343 | finder.</para></sect3>
|
---|
344 |
|
---|
345 | <sect3><title>gnatkr</title>
|
---|
346 | <para><command>gnatkr</command> is used to determine the crunched name for a
|
---|
347 | given file, when crunched to a specified maximum length.</para></sect3>
|
---|
348 |
|
---|
349 | <sect3><title>gnatlink</title>
|
---|
350 | <para><command>gnatlink</command> is used to link programs and build an
|
---|
351 | executable file.</para></sect3>
|
---|
352 |
|
---|
353 | <sect3><title>gnatls</title>
|
---|
354 | <para><command>gnatls</command> is the compiled unit browser.</para></sect3>
|
---|
355 |
|
---|
356 | <sect3><title>gnatmake</title>
|
---|
357 | <para><command>gnatmake</command> is an automatic make facility.</para></sect3>
|
---|
358 |
|
---|
359 | <sect3><title>gnatname</title>
|
---|
360 | <para><command>gnatname</command> will list the files associated with a
|
---|
361 | <application><acronym>GNAT</acronym></application> project.</para></sect3>
|
---|
362 |
|
---|
363 | <sect3><title>gnatmem</title>
|
---|
364 | <para><command>gnatmem</command> is the
|
---|
365 | <application><acronym>GNAT</acronym></application> utility that monitors
|
---|
366 | dynamic allocation and deallocation activity in a program.</para></sect3>
|
---|
367 |
|
---|
368 | <sect3><title>gnatprep</title>
|
---|
369 | <para><command>gnatprep</command> is the
|
---|
370 | <application><acronym>GNAT</acronym></application> external
|
---|
371 | preprocessor.</para></sect3>
|
---|
372 |
|
---|
373 | <sect3><title>gnatxref</title>
|
---|
374 | <para><command>gnatxref</command> is the
|
---|
375 | <application><acronym>GNAT</acronym></application>
|
---|
376 | cross-referencer.</para></sect3>
|
---|
377 |
|
---|
378 | <sect3><title>grepjar</title>
|
---|
379 | <para><command>grepjar</command> searches <filename>jar</filename> files for a
|
---|
380 | pattern.</para></sect3>
|
---|
381 |
|
---|
382 | <sect3><title>jar</title>
|
---|
383 | <para><command>jar</command> is an archive tool for
|
---|
384 | <application>Java</application> archives.</para></sect3>
|
---|
385 |
|
---|
386 | <sect3><title>jcf-dump</title>
|
---|
387 | <para><command>jcf-dump</command> prints information about
|
---|
388 | <application>Java</application> class files.</para></sect3>
|
---|
389 |
|
---|
390 | <sect3><title>jv-convert</title>
|
---|
391 | <para><command>jv-convert</command> converts files from one encoding to
|
---|
392 | another.</para></sect3>
|
---|
393 |
|
---|
394 | <sect3><title>jv-scan</title>
|
---|
395 | <para><command>jv-scan</command> prints information about
|
---|
396 | <application>Java</application> source files.</para></sect3>
|
---|
397 |
|
---|
398 | <sect3><title>rmic</title>
|
---|
399 | <para><command>rmic</command> generates stubs for Remote Method
|
---|
400 | Invocation.</para></sect3>
|
---|
401 |
|
---|
402 | <sect3><title>rmiregistry</title>
|
---|
403 | <para><command>rmiregistry</command> starts a remote object registry on the
|
---|
404 | current host.</para></sect3>
|
---|
405 |
|
---|
406 | </sect2>
|
---|
407 |
|
---|
408 | </sect1>
|
---|
409 |
|
---|