source: general/prog/gcc.xml@ eb091c9

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 eb091c9 was eb091c9, checked in by Randy McMurchy <randy@…>, 20 years ago

Added new package DejaGnu-1.4.4; added linkonce patch to GCC instructions; added instructions to DocBook-utils to create alternate script names

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

  • Property mode set to 100644
File size: 18.0 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-size "27.2 MB">
10 <!ENTITY gcc-buildsize "1.2 GB">
11 <!ENTITY gcc-time "36.2 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.2 MB">
16 <!ENTITY gnat-buildsize "48.9 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
32contains <acronym>GNU</acronym> compilers. This is useful for
33<!-- compiling programs written in <application>Ada</application>, -->
34compiling programs written in
35<application>C</application>, <application>C++</application>,
36<application>Fortran</application>, <application>Java</application> and
37<application>Objective C</application>. The
38<application><acronym>GCC</acronym></application> package also contains an
39<application>Ada</application> compiler, however, the installation
40documentation is flawed and all the <application>Ada</application> tools cannot
41be built using conventional methods.</para>
42
43<sect3><title>Package Information</title>
44<itemizedlist spacing='compact'>
45<listitem><para>Download (HTTP): <ulink
46url="&gcc-download-http;"/></para></listitem>
47<listitem><para>Download (FTP): <ulink
48url="&gcc-download-ftp;"/></para></listitem>
49<listitem><para>Download size: &gcc-size;</para></listitem>
50<listitem><para>Estimated Disk space required:
51&gcc-buildsize;</para></listitem>
52<listitem><para>Estimated build time:
53&gcc-time;</para></listitem></itemizedlist>
54</sect3>
55
56<sect3><title>Additional Downloads</title>
57<itemizedlist spacing='compact'>
58<listitem><para>Required Patch: <ulink
59url="&patch-root;/gcc-&gcc-version;-no_fixincludes-1.patch"/></para></listitem>
60<listitem><para>Required Patch: <ulink
61url="&patch-root;/gcc-&gcc-version;-linkonce-1.patch"/></para></listitem>
62<listitem><para>Test Suite: <ulink
63url="http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-&gcc-version;/gcc-testsuite-&gcc-version;.tar.bz2"/></para>
64</listitem>
65</itemizedlist></sect3>
66
67<sect3><title><application><acronym>GCC</acronym></application>
68Dependencies</title>
69<sect4><title>Recommended</title>
70<itemizedlist spacing='compact'>
71<listitem><para><xref linkend="expect"/> and
72<xref linkend="dejagnu"/></para>
73</listitem></itemizedlist>
74</sect4></sect3>
75
76</sect2>
77
78<sect2>
79<title>Installation of <application><acronym>GCC</acronym></application></title>
80
81<!-- <para>If you plan to compile Ada, you will need to install
82<application><acronym>GNAT</acronym></application> temporarily to
83satisfy the circular dependency when you recompile
84<application><acronym>GCC</acronym></application> to include
85<application>Ada</application>.</para>
86
87<sect3><title>Package information</title>
88<itemizedlist spacing='compact'>
89<listitem><para>Download (HTTP): <ulink
90url="&gnat-download-http;"/></para></listitem>
91<listitem><para>Download (FTP): <ulink
92url="&gnat-download-ftp;"/></para></listitem>
93<listitem><para>Download size: &gnat-size;</para></listitem>
94<listitem><para>Estimated Disk space required:
95&gnat-buildsize;</para></listitem>
96<listitem><para>Estimated build time:
97&gnat-time;</para></listitem></itemizedlist>
98</sect3>
99
100<sect3><title><application><acronym>GNAT</acronym></application>
101dependencies</title>
102<sect4><title>Required</title>
103<para><xref linkend="tcsh"/></para></sect4>
104</sect3>
105
106</sect2>
107
108<sect2>
109<title>Installation of <application><acronym>GNAT</acronym></application>
110</title>
111
112<para>Install <application><acronym>GNAT</acronym></application> by running the
113following commands:</para>
114
115<screen><userinput><command>./doconfig</command></userinput></screen>
116
117<para>The above script will ask you how and where you would like to install
118<application><acronym>GNAT</acronym></application>. To avoid conflicts with the
119system <command>gcc</command>, the package will be installed in a separate
120directory, that can later be removed from the system.</para>
121
122<para>In response to the questions asked by the <command>doconfig</command>
123script, enter <userinput>3</userinput> in response to the first question
124and <userinput>/opt/gnat</userinput> in response to the second question.</para>
125
126<para>To finish the install, run:</para>
127<screen><userinput><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</sect2>
134
135<sect2><title>Return to Installation of
136<application><acronym>GCC</acronym></application></title>
137
138<screen><userinput><command>patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes-1.patch &amp;&amp;
139sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &amp;&amp;
140PATH_HOLD=$PATH &amp;&amp;
141export PATH=/opt/gnat/bin:$PATH &amp;&amp;
142cd gcc/ada &amp;&amp;
143touch treeprs.ads [es]info.h nmake.ad[bs] &amp;&amp;
144cd ../.. &amp;&amp;
145mkdir ../gcc-build &amp;&amp;
146cd ../gcc-build &amp;&amp;
147CC=/usr/bin/gcc ../gcc-&gcc-version;/configure -prefix=/usr -enable-shared \
148../gcc-&gcc-version;/configure -prefix=/usr -libexecdir=/usr/lib \
149 -enable-shared -enable-languages=c,c++,objc,f77,java \
150 -enable-threads=posix -enable-__cxa_atexit -enable-clocale=gnu &amp;&amp;
151make bootstrap &amp;&amp;
152make -C gcc gnatlib_and_tools &amp;&amp;
153make -k check &amp;&amp;
154../gcc-3.4.1/contrib/test_summary &amp;&amp;
155../gcc-3.4.1/contrib/test_summary | grep -A7 Summ &amp;&amp;
156make install &amp;&amp;
157ln -sf ../usr/bin/cpp /lib &amp;&amp;
158ln -sf gcc /usr/bin/cc &amp;&amp;
159ln -sf g77 /usr/bin/f77 &amp;&amp;
160chown -R root:root /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include &amp;&amp;
161export PATH=$PATH_HOLD</command></userinput></screen>
162
163<para>You may remove the <application><acronym>GNAT</acronym></application>
164installation:</para>
165<screen><userinput><command>rm -rf /opt/gnat</command></userinput></screen> -->
166
167<important><para>The installation process may overwrite your existing
168<application><acronym>GCC</acronym></application> compiler and libraries. It
169is strongly recommended that you install the <application>Expect</application>
170and <application>DejaGnu</application> packages as well as unpacking the
171<application><acronym>GCC</acronym></application> testsuite tarball before
172beginning the build.</para>
173
174<para>Do not continue with the <command>make install</command> command until
175you're confident the build was successful. You can compare your test results
176with those found at <ulink
177url="http://gcc.gnu.org/ml/gcc-testresults/"/>. There's also an i686 platform
178test result produced by an <acronym>LFS</acronym> (SVN-testing-040712) system
179at <ulink url="http://www.linuxfromscratch.org/~randy/gcc-test.txt"/>. You may
180also want to refer to the information found in the
181<application><acronym>GCC</acronym></application>-Pass 2 section of Chapter 5
182in the <acronym>LFS</acronym> book.</para></important>
183
184<note><para>Some of the <application>Java</application> programs installed by
185the <application><acronym>GCC</acronym></application> package conflict (have
186the same names) with programs from the <xref linkend="j2sdk"/> package. If
187you're installing the <application>Java</application> language from the
188<application><acronym>GCC</acronym></application> package but you wish to
189use the programs from the <application>JDK</application> as the defaults,
190ensure
191<filename class='directory'><replaceable>[JDKpath]</replaceable>/bin</filename>
192is listed before <filename class='directory'>/usr/bin</filename> in your
193<envar>PATH</envar> variable.</para></note>
194
195<para>Install <application><acronym>GCC</acronym></application> by running the
196following commands:</para>
197
198<screen><userinput><command>patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes-1.patch &amp;&amp;
199patch -Np1 -i ../gcc-&gcc-version;-linkonce-1.patch &amp;&amp;
200sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &amp;&amp;
201mkdir ../gcc-build &amp;&amp;
202cd ../gcc-build &amp;&amp;
203../gcc-&gcc-version;/configure --prefix=/usr --libexecdir=/usr/lib \
204 --enable-shared --enable-languages=c,c++,objc,f77,java \
205 --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu &amp;&amp;
206make bootstrap &amp;&amp;
207make -k check &amp;&amp;
208../gcc-3.4.1/contrib/test_summary &amp;&amp;
209make install &amp;&amp;
210ln -sf ../usr/bin/cpp /lib &amp;&amp;
211ln -sf gcc /usr/bin/cc &amp;&amp;
212ln -sf g77 /usr/bin/f77 &amp;&amp;
213chown -R root:root /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include</command></userinput></screen>
214
215</sect2>
216
217<sect2>
218<title>Command explanations</title>
219
220<!-- <para><command>PATH_HOLD=$PATH</command>: This command
221stores your current path before it's modified so that it can be restored after
222installation.</para>
223
224<para><command>export PATH=/opt/gnat/bin:$PATH</command>: This
225command allows the build to find
226<application><acronym>GNAT</acronym></application>'s
227<application>Ada</application> compiler to build
228<application>Ada</application>.</para>
229
230<para><command>touch treeprs.ads [es]info.h nmake.ad[bs]</command>:
231This command creates necessary files for the
232<application>Ada</application> build. This step
233may be skipped if you don't want to compile the
234<application>Ada</application> front end.</para>
235
236<para><parameter>CC=/usr/bin/gcc</parameter>: This command works around the
237new <envar>PATH</envar> which puts <application><acronym>GNAT</acronym>
238</application>'s <command>gcc</command> as the primary compiler.</para> -->
239
240<para><command>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</command>:
241This command suppresses the installation of
242<filename class='libraryfile'>libiberty.a</filename> as the version provided
243by <application>Binutils</application> is used instead.</para>
244
245<para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
246<application><acronym>GCC</acronym></application> documentation recommends
247building the package in a dedicated build directory.</para>
248
249<para><parameter>--enable-languages=c,c++,objc,f77,ada,java</parameter>:
250This command identifies which languages to build. You may modify this command
251to remove unwanted languages.</para>
252
253<para><parameter>--enable-shared --enable-threads=posix
254--enable-__cxa_atexit</parameter>: These commands are required to build
255the <application>C++</application> libraries to published standards.</para>
256
257<para><parameter>--enable-clocale=gnu</parameter>: This command is a
258failsafe for incomplete locale data.</para>
259
260<para><command>make -k check</command>: This command runs the test suite
261without stopping should any errors be encountered.</para>
262
263<para><command>../gcc-3.4.1/contrib/test_summary</command>: This command will
264produce a summary of the test suite results. You can append
265<command>| grep -A7 Summ</command> to the command to produce an even more
266condensed version of the summary. You may also wish to redirect the output to
267a file for review and comparison later on.</para>
268
269<para><command>ln -sf ../usr/bin/cpp /lib</command>: This command creates a
270link to the C PreProcessor as some packages expect it to be installed in the
271<filename class='directory'>/lib</filename> directory.</para>
272
273<para><command>ln -sf gcc /usr/bin/cc; ln -sf g77 /usr/bin/f77</command>:
274These links are created as some packages refer to the C and Fortran compilers
275using an alternate name.</para>
276
277<para><command>chown -R root:root /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include</command>:
278If the package is built by a user other than root, the ownership of the
279installed <filename class='directory'>include</filename> directory (and its
280contents) will be incorrect. This command changes the ownership to
281root:root.</para>
282
283<!-- <para><command>make gnatlib_and tools</command>: This command
284completes the <application>Ada</application> build process. Skip this step if
285you have not enabled <application>Ada</application> as one of the languages.
286</para> -->
287
288</sect2>
289
290<sect2>
291<title>Contents</title>
292
293<para>The <application><acronym>GCC</acronym></application> package contains
294<command>addr2name.awk</command>, <command>c++</command>,
295<command>cpp</command>, <command>g++</command>,
296<command>g77</command>, <command>gcc</command>,
297<command>gccbug</command>, <command>gcj</command>,
298<command>gcjh</command>, <command>gcov</command>,
299<command>gij</command>, <command>grepjar</command>,
300<command>jar</command>, <command>jcf-dump</command>,
301<command>jv-convert</command>, <command>jv-scan</command>,
302<command>rmic</command>, <command>rmiregistry</command> and
303<!-- <command>gnat</command>, <command>gnatbind</command>,
304<command>gnatbl</command>, <command>gnatchop</command>,
305<command>gnatfind</command>, <command>gnatkr</command>,
306<command>gnatlink</command>, <command>gnatls</command>,
307<command>gnatmake</command>, <command>gnatprep</command>,
308<command>gnatpsta</command>, <command>gnatpsys</command>,
309<command>gnatxref</command> and -->
310<application><acronym>GCC</acronym></application> libraries.</para>
311
312</sect2>
313
314<sect2><title>Description</title>
315
316<para>The programs and libraries whose descriptions are missing here
317have been described in the <acronym>LFS</acronym>
318<acronym>GCC</acronym>-&gcc-version; page.</para>
319
320<sect3><title>addr2name.awk</title>
321<para><command>addr2name.awk</command> emulates a little of the functionality
322of addr2line.</para></sect3>
323
324<sect3><title>g77</title>
325<para><command>g77</command> is the <application>Fortran</application> compiler
326invoked by <command>gcc</command>.</para></sect3>
327
328<sect3><title>gcj</title>
329<para><command>gcj</command> is an ahead-of-time compiler for the
330<application>Java</application> language.</para></sect3>
331
332<sect3><title>gcjh</title>
333<para><command>gcjh</command> generates header files from
334<application>Java</application> class files.</para></sect3>
335
336<sect3><title>gij</title>
337<para><command>gij</command> is the <acronym>GNU</acronym> interpreter for
338<application>Java</application> bytecode.</para></sect3>
339
340<sect3><title>grepjar</title>
341<para><command>grepjar</command> searches <filename>jar</filename> files for a
342pattern.</para></sect3>
343
344<sect3><title>jar</title>
345<para><command>jar</command> is an archive tool for
346<application>Java</application> archives.</para></sect3>
347
348<sect3><title>jcf-dump</title>
349<para><command>jcf-dump</command> prints information about
350<application>Java</application> class files.</para></sect3>
351
352<sect3><title>jv-convert</title>
353<para><command>jv-convert</command> converts files from one encoding to
354another.</para></sect3>
355
356<sect3><title>jv-scan</title>
357<para><command>jv-scan</command> prints information about
358<application>Java</application> source files.</para></sect3>
359
360<sect3><title>rmic</title>
361<para><command>rmic</command> generates stubs for Remote Method
362Invocation.</para></sect3>
363
364<sect3><title>rmiregistry</title>
365<para><command>rmiregistry</command> starts a remote object registry on the
366current host.</para></sect3>
367
368<!-- <sect3><title>gdb</title>
369<para><command>gdb</command> is the
370<application><acronym>GNAT</acronym></application> debugger.</para></sect3>
371
372<sect3><title>gnatbind</title>
373<para><command>gnatbind</command> is used to bind compiled objects.</para>
374</sect3>
375
376<sect3><title>gnatbl</title>
377<para><command>gnatbl</command> is the <application>Ada</application> linker.
378</para></sect3>
379
380<sect3><title>gnatchop</title>
381<para><command>gnatchop</command> is useful for renaming files to meet the
382standard <application>Ada</application> default file naming conventions.</para></sect3>
383
384<sect3><title>gnatelim</title>
385<para><command>gnatelim</command> is used to detect and eliminate unused
386subprograms in an <application>Ada</application> partition.</para></sect3>
387
388<sect3><title>gnatfind</title>
389<para><command>gnatfind</command> is the <application><acronym>GNAT</acronym>
390</application> definition/use finder.</para></sect3>
391
392<sect3><title>gnatgcc</title>
393<para><command>gnatgcc</command> is the compiler.</para></sect3>
394
395<sect3><title>gnathtml.pl</title>
396<para><command>gnathtml.pl</command> converts
397<application>Ada</application> source files to <acronym>HTML</acronym> for
398viewing in Web browsers.</para></sect3>
399
400<sect3><title>gnatkr</title>
401<para><command>gnatkr</command> is used to determine the crunched name for a
402given file, when crunched to a specified maximum length.</para></sect3>
403
404<sect3><title>gnatlink</title>
405<para><command>gnatlink</command> is used to link programs and build an
406executable file.</para></sect3>
407
408<sect3><title>gnatls</title>
409<para><command>gnatls</command> is the compiled unit browser.</para></sect3>
410
411<sect3><title>gnatemake</title>
412<para><command>gnatmake</command> is an automatic make facility.</para></sect3>
413
414<sect3><title>gnatmem</title>
415<para><command>gnatmem</command> is the <application><acronym>GNAT</acronym>
416</application> utility that monitors dynamic allocation and
417deallocation activity in a program.</para></sect3>
418
419<sect3><title>gnatprep</title>
420<para><command>gnatprep</command> is the
421<application><acronym>GNAT</acronym></application> external preprocessor.</para>
422</sect3>
423
424<sect3><title>gnatpsta</title>
425<para><command>gnatpsta</command> determines the values of all the relevant
426parameters in Standard and outputs to stdout.</para></sect3>
427
428<sect3><title>gnatpsys</title>
429<para><command>gnatpsys</command> determines the values of all the relevant
430parameters in System and outputs to stdout.</para></sect3>
431
432<sect3><title>gnatstub</title>
433<para><command>gnatstub</command> is a generator of body stubs.</para></sect3>
434
435<sect3><title>gnatxref</title>
436<para><command>gnatxref</command> is the <application><acronym>GNAT</acronym></application> cross-referencer.</para></sect3> -->
437
438</sect2>
439
440</sect1>
441
Note: See TracBrowser for help on using the repository browser.