source: general/prog/gcc.xml@ 31a4e72

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 31a4e72 was f1e6f61d, checked in by Randy McMurchy <randy@…>, 19 years ago

Changed absolute linuxfromscratch URL's to lfs-root entity in Shadow, GCC and VIM instructions

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3476 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 20.3 KB
Line 
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-md5sum "31b459062499f9f68d451db9cbf3205c">
10 <!ENTITY gcc-size "27.2 MB">
11 <!ENTITY gcc-buildsize "1.53 GB">
12 <!ENTITY gcc-time "48.94 SBU">
13
14 <!ENTITY gnat-download-http " ">
15 <!ENTITY gnat-download-ftp "ftp://cs.nyu.edu/pub/gnat/3.15p/gnat-3.15p-i686-pc-redhat71-gnu-bin.tar.gz">
16 <!ENTITY gnat-size "13.5 MB">
17 <!ENTITY gnat-buildsize "48 MB">
18 <!ENTITY gnat-time "0.01 SBU">
19]>
20
21<sect1 id="gcc" xreflabel="GCC-&gcc-version;">
22<sect1info>
23<othername>$LastChangedBy$</othername>
24<date>$Date$</date>
25</sect1info>
26<?dbhtml filename="gcc.html" ?>
27<title>GCC-&gcc-version;</title>
28<indexterm zone="gcc">
29<primary sortas="a-gcc-3-4">GCC-&gcc-version;</primary></indexterm>
30
31<sect2>
32<title>Introduction to <application><acronym>GCC</acronym></application></title>
33
34<para>The <application><acronym>GCC</acronym></application> package contains
35<acronym>GNU</acronym> compilers. This is useful for compiling programs
36written in <application>C</application>, <application>C++</application>,
37<application>Fortran</application>, <application>Java</application>,
38<application>Objective C</application> and
39<application>Ada</application>.</para>
40
41<sect3><title>Package Information</title>
42<itemizedlist spacing='compact'>
43<listitem><para>Download (HTTP): <ulink
44url="&gcc-download-http;"/></para></listitem>
45<listitem><para>Download (FTP): <ulink
46url="&gcc-download-ftp;"/></para></listitem>
47<listitem><para>Download MD5 sum: &gcc-md5sum;</para></listitem>
48<listitem><para>Download size: &gcc-size;</para></listitem>
49<listitem><para>Estimated disk space required:
50&gcc-buildsize;</para></listitem>
51<listitem><para>Estimated build time:
52&gcc-time;</para></listitem></itemizedlist>
53</sect3>
54
55<sect3><title>Additional Downloads</title>
56<itemizedlist spacing='compact'>
57<listitem><para>Required Patch: <ulink
58url="&patch-root;/gcc-&gcc-version;-no_fixincludes-1.patch"/></para></listitem>
59<listitem><para>Required Patch: <ulink
60url="&patch-root;/gcc-&gcc-version;-linkonce-1.patch"/></para></listitem>
61<listitem><para>Test Suite: <ulink
62url="http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-&gcc-version;/gcc-testsuite-&gcc-version;.tar.bz2"/></para>
63</listitem>
64</itemizedlist></sect3>
65
66<sect3><title><application><acronym>GCC</acronym></application>
67Dependencies</title>
68<sect4><title>Recommended</title>
69<itemizedlist spacing='compact'>
70<listitem><para><xref linkend="dejagnu"/></para></listitem>
71</itemizedlist>
72</sect4></sect3>
73
74</sect2>
75
76<sect2>
77<title>Installation of <application><acronym>GCC</acronym></application></title>
78
79<para>If you plan to compile Ada, you will need to install
80<application><acronym>GNAT</acronym></application> temporarily to
81satisfy the circular dependency when you recompile
82<application><acronym>GCC</acronym></application> to include
83<application>Ada</application>.</para>
84
85<sect3><title>Package information</title>
86<itemizedlist spacing='compact'>
87<listitem><para>Download (HTTP): <ulink
88url="&gnat-download-http;"/></para></listitem>
89<listitem><para>Download (FTP): <ulink
90url="&gnat-download-ftp;"/></para></listitem>
91<listitem><para>Download size: &gnat-size;</para></listitem>
92<listitem><para>Estimated disk space required:
93&gnat-buildsize;</para></listitem>
94<listitem><para>Estimated build time:
95&gnat-time;</para></listitem></itemizedlist>
96</sect3>
97
98<sect3><title><application><acronym>GNAT</acronym></application>
99dependencies</title>
100<sect4><title>Required</title>
101<para><xref linkend="tcsh"/></para>
102</sect4>
103</sect3>
104
105</sect2>
106
107<sect2>
108<title>Installation of <application><acronym>GNAT</acronym></application>
109</title>
110
111<para>Install <application><acronym>GNAT</acronym></application> by running
112the following commands:</para>
113
114<screen><userinput><command>./doconfig</command></userinput></screen>
115
116<para>The above script will ask you how and where you would like to install
117<application><acronym>GNAT</acronym></application>. To avoid conflicts with
118the system <command>gcc</command>, the package will be installed in a separate
119directory, that can later be removed from the system.</para>
120
121<para>In response to the questions asked by the <command>doconfig</command>
122script, enter <userinput>3</userinput> in response to the first question
123and <userinput>/opt/gnat</userinput> in response to the second question.</para>
124
125<para>To finish the install, run the following command as the root user:</para>
126
127<screen><userinput role='root'><command>./doinstall</command></userinput></screen>
128
129<para>The <application><acronym>GNAT</acronym></application> compiler can be
130invoked by executing the <command>gcc</command> binary installed by the above
131script.</para>
132
133<para>Prepare to compile <application>GCC</application> by placing the
134<application>GNAT</application> <command>gcc</command> at the beginning of
135the <envar>PATH</envar> variable by using the following commands:</para>
136
137<screen><userinput><command>PATH_HOLD=$PATH &amp;&amp;
138export PATH=/opt/gnat/bin:$PATH</command></userinput></screen>
139
140</sect2>
141
142<sect2><title>Return to Installation of
143<application><acronym>GCC</acronym></application></title>
144
145<para>Install <application><acronym>GCC</acronym></application> by running the
146following commands:</para>
147
148<important><para>The installation process may overwrite your existing
149<application><acronym>GCC</acronym></application> compiler and libraries. It
150is highly recommended that you have the <application>Tcl</application>,
151<application>Expect</application> and <application>DejaGnu</application>
152packages installed, as well as unpacking the
153<application><acronym>GCC</acronym></application> testsuite tarball before
154beginning the build.</para>
155
156<para>Do not continue with the <command>make install</command> command until
157you're confident the build was successful. You can compare your test results
158with those found at <ulink
159url="http://gcc.gnu.org/ml/gcc-testresults/"/>. There's also an i686 platform
160test result produced by an <acronym>LFS</acronym>-6.0 system at
161<ulink url="http://linuxfromscratch.org/~randy/gcc341_test.txt"/>. You
162may also want to refer to the information found in the
163<application><acronym>GCC</acronym></application>-Pass 2 section of Chapter 5
164in the <acronym>LFS</acronym> book.</para></important>
165
166<note><para>Some of the <application>Java</application> programs installed by
167the <application><acronym>GCC</acronym></application> package conflict (have
168the same names) with programs from the <xref linkend="j2sdk"/> package. If
169you're installing the <application>Java</application> language from the
170<application><acronym>GCC</acronym></application> package but you wish to
171use the programs from the <application>JDK</application> as the defaults,
172ensure <filename class='directory'>$JAVA_HOME/bin</filename> is listed before
173<filename class='directory'>/usr/bin</filename> in your <envar>PATH</envar>
174variable.</para></note>
175
176<screen><userinput><command>patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes-1.patch &amp;&amp;
177patch -Np1 -i ../gcc-&gcc-version;-linkonce-1.patch &amp;&amp;
178sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &amp;&amp;
179mkdir ../gcc-build &amp;&amp;
180cd ../gcc-build &amp;&amp;
181../gcc-&gcc-version;/configure --prefix=/usr --libexecdir=/usr/lib \
182 --enable-shared --enable-languages=c,c++,objc,f77,ada,java \
183 --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu &amp;&amp;
184make bootstrap &amp;&amp;
185make -C gcc gnatlib-shared &amp;&amp;
186make -C gcc gnattools &amp;&amp;
187make -k check &amp;&amp;
188../gcc-3.4.1/contrib/test_summary</command></userinput></screen>
189
190<para>Now, as the root user:</para>
191
192<screen><userinput role='root'><command>make install &amp;&amp;
193ln -v -sf ../usr/bin/cpp /lib &amp;&amp;
194ln -v -sf gcc /usr/bin/cc &amp;&amp;
195ln -v -sf g77 /usr/bin/f77 &amp;&amp;
196chown -v -R root:root /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include</command></userinput></screen>
197
198<para>You may remove the <application><acronym>GNAT</acronym></application>
199installation and restore your old <envar>PATH</envar>:</para>
200
201<screen><userinput><command>rm -rf /opt/gnat &amp;&amp;
202export PATH=$PATH_HOLD</command></userinput></screen>
203
204</sect2>
205
206<sect2>
207<title>Command explanations</title>
208
209<para><command>sed -i 's/install_to_$(INSTALL_DEST) //'
210libiberty/Makefile.in</command>: This command suppresses the installation of
211<filename class='libraryfile'>libiberty.a</filename> as the version provided
212by <application>Binutils</application> is used instead.</para>
213
214<para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
215<application><acronym>GCC</acronym></application> documentation recommends
216building the package in a dedicated build directory.</para>
217
218<para><parameter>--enable-languages=c,c++,objc,f77,ada,java</parameter>:
219This command identifies which languages to build. You may modify this command
220to remove undesired languages.</para>
221
222<para><parameter>--enable-shared --enable-threads=posix
223--enable-__cxa_atexit</parameter>: These commands are required to build
224the <application>C++</application> libraries to published standards.</para>
225
226<para><parameter>--enable-clocale=gnu</parameter>: This command is a
227failsafe for incomplete locale data.</para>
228
229<para><command>make -C gcc gnatlib-shared</command>: This command builds the
230Ada shared and static libraries. Skip this step if you have not enabled
231<application>Ada</application> as one of the languages.</para>
232
233<para><command>make -C gcc gnattools</command>: This command builds the
234Ada development tools and binaries. Skip this step if you have not enabled
235<application>Ada</application> as one of the languages.</para>
236
237<para><command>make -k check</command>: This command runs the test suite
238without stopping should any errors be encountered.</para>
239
240<para><command>../gcc-3.4.1/contrib/test_summary</command>: This command will
241produce a summary of the test suite results. You can append
242<command>| grep -A7 Summ</command> to the command to produce an even more
243condensed version of the summary. You may also wish to redirect the output to
244a file for review and comparison later on.</para>
245
246<para><command>ln -sf ../usr/bin/cpp /lib</command>: This command creates a
247link to the C PreProcessor as some packages expect it to be installed in the
248<filename class='directory'>/lib</filename> directory.</para>
249
250<para><command>ln -sf gcc /usr/bin/cc; ln -sf g77 /usr/bin/f77</command>:
251These links are created as some packages refer to the C and Fortran compilers
252using an alternate name.</para>
253
254<para><command>chown -R root:root
255/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include</command>:
256If the package is built by a user other than root, the ownership of the
257installed <filename class='directory'>include</filename> directory (and its
258contents) will be incorrect. This command changes the ownership to
259root:root.</para>
260
261</sect2>
262
263<sect2>
264<title>Contents</title>
265
266<segmentedlist>
267<segtitle>Installed Programs</segtitle>
268<segtitle>Installed Libraries</segtitle>
269<segtitle>Installed Directories</segtitle>
270
271<seglistitem>
272<seg>addr2name.awk, cc, c++, cpp, f77, g++, g77, gcc, gccbug, gcj, gcjh, gcov,
273gij, gnat, gnatbind, gnatbl, gnatchop, gnatclean, gnatfind, gnatkr, gnatlink,
274gnatls, gnatmake, gnatname, gnatprep, gnatxref, gpr2make, gprcmd, grepjar,
275jar, jcf-dump, jv-convert, jv-scan, rmic, rmiregistry and architecture
276specific names for c++, g++, gcc{,-3.4.1}, gcj and gcjh</seg>
277<seg>lib-org-w3c-dom.[so,a], lib-org-xml-sax.[so,a], libffi-2.00-beta.so,
278libffi.[so,a], libfrtbegin.a, libg2c.[so,a], libgcc_s.so, libgcj.[so,a],
279libobjc.[so,a], libstdc++.[so.6,a], libsupc++.a and numerous other run-time
280libraries and executables in /usr/lib/gcc</seg>
281<seg>/usr/include/c++, /usr/include/gcj, /usr/include/gnu, /usr/include/java,
282/usr/include/javax, /usr/lib/gcc, /usr/lib/security, /usr/share/gnat and
283/usr/share/java</seg>
284</seglistitem>
285</segmentedlist>
286
287<variablelist>
288<bridgehead renderas="sect3">Short Descriptions</bridgehead>
289<?dbfo list-presentation="list"?>
290
291<para>Some program and library descriptions are not listed here, but can be
292found at <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/>.</para>
293
294<varlistentry id="addr2name.awk">
295<term><command>addr2name.awk</command></term>
296<listitem><para> emulates some of the functionality of addr2line.</para>
297<indexterm zone="gcc addr2name.awk">
298<primary sortas="b-addr2name.awk">addr2name.awk</primary>
299</indexterm></listitem>
300</varlistentry>
301
302<varlistentry id="f77">
303<term><command>f77</command></term>
304<listitem><para>is a symlink to <command>g77</command>, created for
305compatibility purposes.</para>
306<indexterm zone="gcc f77">
307<primary sortas="g-f77">f77</primary>
308</indexterm></listitem>
309</varlistentry>
310
311<varlistentry id="g77">
312<term><command>g77</command></term>
313<listitem><para>is the <application>Fortran</application> compiler invoked by
314<command>gcc</command>.</para>
315<indexterm zone="gcc g77">
316<primary sortas="b-g77">g77</primary>
317</indexterm></listitem>
318</varlistentry>
319
320<varlistentry id="gcj">
321<term><command>gcj</command></term>
322<listitem><para>is an ahead-of-time compiler for the
323<application>Java</application> language.</para>
324<indexterm zone="gcc gcj">
325<primary sortas="b-gcj">gcj</primary>
326</indexterm></listitem>
327</varlistentry>
328
329<varlistentry id="gcjh">
330<term><command>gcjh</command></term>
331<listitem><para>generates header files from <application>Java</application>
332class files.</para>
333<indexterm zone="gcc gcjh">
334<primary sortas="b-gcjh">gcjh</primary>
335</indexterm></listitem>
336</varlistentry>
337
338<varlistentry id="gij">
339<term><command>gij</command></term>
340<listitem><para>is the <acronym>GNU</acronym> interpreter for
341<application>Java</application> bytecode.</para>
342<indexterm zone="gcc gij">
343<primary sortas="b-gij">gij</primary>
344</indexterm></listitem>
345</varlistentry>
346
347<varlistentry id="gnat">
348<term><command>gnat</command></term>
349<listitem><para>is the <application>Ada</application> compiler invoked by
350<command>gcc</command>.</para>
351<indexterm zone="gcc gnat">
352<primary sortas="b-gnat">gnat</primary>
353</indexterm></listitem>
354</varlistentry>
355
356<varlistentry id="gnatbind">
357<term><command>gnatbind</command></term>
358<listitem><para>is used to bind compiled objects.</para>
359<indexterm zone="gcc gnatbind">
360<primary sortas="b-gnatbind">gnatbind</primary>
361</indexterm></listitem>
362</varlistentry>
363
364<varlistentry id="gnatbl">
365<term><command>gnatbl</command></term>
366<listitem><para>is the <application>Ada</application> linker.</para>
367<indexterm zone="gcc gnatbl">
368<primary sortas="b-gnatbl">gnatbl</primary>
369</indexterm></listitem>
370</varlistentry>
371
372<varlistentry id="gnatchop">
373<term><command>gnatchop</command></term>
374<listitem><para> is useful for renaming files to meet the standard
375<application>Ada</application> default file naming conventions.</para>
376<indexterm zone="gcc gnatchop">
377<primary sortas="b-gnatchop">gnatchop</primary>
378</indexterm></listitem>
379</varlistentry>
380
381<varlistentry id="gnatclean">
382<term><command>gnatclean</command></term>
383<listitem><para>is used to remove files associated with a
384<application><acronym>GNAT</acronym></application> project.</para>
385<indexterm zone="gcc gnatclean">
386<primary sortas="b-gnatclean">gnatclean</primary>
387</indexterm></listitem>
388</varlistentry>
389
390<varlistentry id="gnatfind">
391<term><command>gnatfind</command></term>
392<listitem><para> is the <application><acronym>GNAT</acronym></application>
393definition/use finder.</para>
394<indexterm zone="gcc gnatfind">
395<primary sortas="b-gnatfind">gnatfind</primary>
396</indexterm></listitem>
397</varlistentry>
398
399<varlistentry id="gnatkr">
400<term><command>gnatkr</command></term>
401<listitem><para>is used to determine the crunched name for a given file, when
402crunched to a specified maximum length.</para>
403<indexterm zone="gcc gnatkr">
404<primary sortas="b-gnatkr">gnatkr</primary>
405</indexterm></listitem>
406</varlistentry>
407
408<varlistentry id="gnatlink">
409<term><command>gnatlink</command></term>
410<listitem><para>is used to link programs and build an executable file.</para>
411<indexterm zone="gcc gnatlink">
412<primary sortas="b-gnatlink">gnatlink</primary>
413</indexterm></listitem>
414</varlistentry>
415
416<varlistentry id="gnatls">
417<term><command>gnatls</command></term>
418<listitem><para>is the compiled unit browser.</para>
419<indexterm zone="gcc gnatls">
420<primary sortas="b-gnatls">gnatls</primary>
421</indexterm></listitem>
422</varlistentry>
423
424<varlistentry id="gnatmake">
425<term><command>gnatmake</command></term>
426<listitem><para>is an automatic <command>make</command> facility.</para>
427<indexterm zone="gcc gnatmake">
428<primary sortas="b-gnatmake">gnatmake</primary>
429</indexterm></listitem>
430</varlistentry>
431
432<varlistentry id="gnatname">
433<term><command>gnatname</command></term>
434<listitem><para>will list the files associated with a
435<application><acronym>GNAT</acronym></application> project.</para>
436<indexterm zone="gcc gnatname">
437<primary sortas="b-gnatname">gnatname</primary>
438</indexterm></listitem>
439</varlistentry>
440
441<varlistentry id="gnatprep">
442<term><command>gnatprep</command></term>
443<listitem><para>is the <application><acronym>GNAT</acronym></application>
444external preprocessor.</para>
445<indexterm zone="gcc gnatprep">
446<primary sortas="b-gnatprep">gnatprep</primary>
447</indexterm></listitem>
448</varlistentry>
449
450<varlistentry id="gnatxref">
451<term><command>gnatxref</command></term>
452<listitem><para>is the <application><acronym>GNAT</acronym></application>
453cross-referencer.</para>
454<indexterm zone="gcc gnatxref">
455<primary sortas="b-gnatxref">gnatxref</primary>
456</indexterm></listitem>
457</varlistentry>
458
459<varlistentry id="gpr2make">
460<term><command>gpr2make</command></term>
461<listitem><para>is a tool used to create <filename>Makefile</filename>s that
462support compilation by multiple languages.</para>
463<indexterm zone="gcc gpr2make">
464<primary sortas="b-gpr2make">gpr2make</primary>
465</indexterm></listitem>
466</varlistentry>
467
468<varlistentry id="gprcmd">
469<term><command>gprcmd</command></term>
470<listitem><para>is a utility used by <filename>Makefile.generic</filename> to
471handle multi-language builds. It provides a set of commands so that the
472<filename>Makefile</filename>s do not need to depend on Unix utilities not
473available on all targets.</para>
474<indexterm zone="gcc gprcmd">
475<primary sortas="b-gprcmd">gprcmd</primary>
476</indexterm></listitem>
477</varlistentry>
478
479<varlistentry id="grepjar">
480<term><command>grepjar</command></term>
481<listitem><para>searches <filename>jar</filename> files for a pattern.</para>
482<indexterm zone="gcc grepjar">
483<primary sortas="b-grepjar">grepjar</primary>
484</indexterm></listitem>
485</varlistentry>
486
487<varlistentry id="jar-gcc">
488<term><command>jar</command></term>
489<listitem><para>is an archive tool for <application>Java</application>
490archives.</para>
491<indexterm zone="gcc jar-gcc">
492<primary sortas="b-jar">jar</primary>
493</indexterm></listitem>
494</varlistentry>
495
496<varlistentry id="jcf-dump">
497<term><command>jcf-dump</command></term>
498<listitem><para>prints information about <application>Java</application>
499class files.</para>
500<indexterm zone="gcc jcf-dump">
501<primary sortas="b-jcf-dump">jcf-dump</primary>
502</indexterm></listitem>
503</varlistentry>
504
505<varlistentry id="jv-convert">
506<term><command>jv-convert</command></term>
507<listitem><para>converts files from one encoding to another.</para>
508<indexterm zone="gcc jv-convert">
509<primary sortas="b-jv-convert">jv-convert</primary>
510</indexterm></listitem>
511</varlistentry>
512
513<varlistentry id="jv-scan">
514<term><command>jv-scan</command></term>
515<listitem><para>prints information about <application>Java</application>
516source files.</para>
517<indexterm zone="gcc jv-scan">
518<primary sortas="b-jv-scan">jv-scan</primary>
519</indexterm></listitem>
520</varlistentry>
521
522<varlistentry id="rmic-gcc">
523<term><command>rmic</command></term>
524<listitem><para>generates stubs for Remote Method Invocation.</para>
525<indexterm zone="gcc rmic-gcc">
526<primary sortas="b-rmic">rmic</primary>
527</indexterm></listitem>
528</varlistentry>
529
530<varlistentry id="rmiregistry-gcc">
531<term><command>rmiregistry</command></term>
532<listitem><para> starts a remote object registry on the current host.</para>
533<indexterm zone="gcc rmiregistry-gcc">
534<primary sortas="b-rmiregistry">rmiregistry</primary>
535</indexterm></listitem>
536</varlistentry>
537
538</variablelist>
539
540</sect2>
541
542</sect1>
543
Note: See TracBrowser for help on using the repository browser.