source: general/prog/gcc-ada.xml@ 5fd1f25b

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 5fd1f25b was 5fd1f25b, checked in by Pierre Labastie <pieere@…>, 9 years ago

Change the patch name in GCC instructions

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

  • Property mode set to 100644
File size: 18.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY gcc-download-http "https://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
8 <!ENTITY gcc-download-ftp "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
9 <!ENTITY gcc-md5sum "d5525b1127d07d215960e6051c5da35e">
10 <!ENTITY gcc-size "91 MB">
11 <!ENTITY gcc-ada-buildsize "6.4 GB (0.7 GB added if GNAT install dir is not removed)">
12 <!ENTITY gcc-ada-time "125 SBU (including 73 SBU for tests)">
13
14 <!ENTITY gnat-download-http "https://libre.adacore.com/download/">
15 <!ENTITY gnat-64-download-http "http://mirrors.cdn.adacore.com/art/7427735035ecc98968ebfcee17494161b0de28ef">
16 <!ENTITY gnat-64-md5sum "c0863ed75109b5aa737becfd5a6ec038">
17 <!ENTITY gnat-64-size "225 MB">
18 <!ENTITY gnat-32-download-http "http://mirrors.cdn.adacore.com/art/3fc05fc61cbc7ab4f291ed19ea4cb269fffd17bd">
19 <!ENTITY gnat-32-md5sum "69423c7ad8d9759377d4fff71a78992d">
20 <!ENTITY gnat-32-size "222 MB">
21]>
22
23<sect1 id="gcc-ada" xreflabel="GCC-Ada-&gcc-version;">
24 <?dbhtml filename="gcc-ada.html" ?>
25
26 <sect1info>
27 <othername>$LastChangedBy$</othername>
28 <date>$Date$</date>
29 </sect1info>
30
31 <title>GCC-Ada-&gcc-version;</title>
32
33 <indexterm zone="gcc-ada">
34 <primary sortas="a-gcc-4-0">GCC-Ada&gcc-version;</primary>
35 </indexterm>
36
37 <sect2 role="package">
38 <title>Introduction to the GCC Ada compiler</title>
39
40 <para>
41 Ada is a modern programming language designed for large, long-lived
42 applications &mdash; and embedded systems in particular &mdash; where
43 reliability and efficiency are essential. It has a set of unique technical
44 features that make it highly effective for use in large, complex and
45 safety-critical projects.
46 </para>
47
48 <para>
49 The compiler and associated tools on this page are known as the
50 <application>GNAT</application> technology, developed by the Adacore
51 company, using the <application>GCC</application> backend. Since
52 parts of the Ada compiler are written in Ada, there is a circular
53 dependency on an Ada compiler. The instructions below first install
54 a binary compiler. You do not need to do that if you already have built
55 <application>GNAT</application> tools.
56 </para>
57
58 &lfs77_checked;
59
60 <caution>
61 <para>
62 Using the instructions on this page will have the effect that
63 the C and C++ compiler and libraries will be reinstalled, overwriting
64 the ones on your system. This may lead to some issues. Please read the
65 notes and caution on the <xref linkend="gcc"/> page.
66 </para>
67 </caution>
68
69 <note>
70 <para>
71 If you want to install other compilers in the <application>GCC
72 </application> collection, do that first, or specify ada in the
73 <parameter>--enable-languages</parameter> switch to <command>
74 configure</command>. If you rebuild <application>GCC</application>
75 without enabling ada after running the instructions on this page,
76 the new compiler will not be able to compile ADA anymore.
77 </para>
78 </note>
79
80 <bridgehead renderas="sect3">Package Information</bridgehead>
81 <itemizedlist spacing="compact">
82 <listitem>
83 <para>
84 Download (HTTP): <ulink url="&gcc-download-http;"/>
85 </para>
86 </listitem>
87 <listitem>
88 <para>
89 Download (FTP): <ulink url="&gcc-download-ftp;"/>
90 </para>
91 </listitem>
92 <listitem>
93 <para>
94 Download MD5 sum: &gcc-md5sum;
95 </para>
96 </listitem>
97 <listitem>
98 <para>
99 Download size: &gcc-size;
100 </para>
101 </listitem>
102 <listitem>
103 <para>
104 Estimated disk space required: &gcc-ada-buildsize;
105 </para>
106 </listitem>
107 <listitem>
108 <para>
109 Estimated build time: &gcc-ada-time;
110 </para>
111 </listitem>
112 </itemizedlist>
113
114 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
115 <note>
116 <para>
117 You will need to install <application>GNAT</application>
118 temporarily to satisfy the circular dependency. You may point your
119 browser to the <ulink url="&gnat-download-http;">AdaCore download
120 page</ulink>, choose your platform and 2014, then select the file
121 to download. Alternatively, direct links to the 64 bit and 32 bit
122 linux versions are given below.
123 </para>
124 </note>
125
126 <itemizedlist spacing="compact">
127 <listitem>
128 <para>
129 GNAT 64 bit binary: <ulink url="&gnat-64-download-http;"/>
130 </para>
131 </listitem>
132 <listitem>
133 <para>
134 GNAT 64 bit MD5 sum: &gnat-64-md5sum;
135 </para>
136 </listitem>
137 <listitem>
138 <para>
139 GNAT 64 bit size: &gnat-64-size;
140 </para>
141 </listitem>
142 <listitem>
143 <para>
144 GNAT 32 bit binary: <ulink url="&gnat-32-download-http;"/>
145 </para>
146 </listitem>
147 <listitem>
148 <para>
149 GNAT 32 bit MD5 sum: &gnat-32-md5sum;
150 </para>
151 </listitem>
152 <listitem>
153 <para>
154 GNAT 32 bit size: &gnat-32-size;
155 </para>
156 </listitem>
157 <listitem>
158 <para>
159 Required patch:
160 <ulink url="&patch-root;/gcc-&gcc-version;-upstream_fixes-1.patch"/>
161 </para>
162 </listitem>
163 </itemizedlist>
164
165 <bridgehead renderas="sect3">GCC Ada Dependencies</bridgehead>
166
167 <bridgehead renderas="sect4">Recommended</bridgehead>
168 <para role="recommended">
169 <xref linkend="dejagnu"/>, for tests
170 </para>
171
172 <para condition="html" role="usernotes">User Notes:
173 <ulink url="&blfs-wiki;/gcc-ada"/></para>
174
175 </sect2>
176
177 <sect2 role="installation">
178 <title>Installation of the GNAT binary</title>
179
180 <para>
181 Before unpacking and changing into the GCC source directory, first
182 unpack the <application>GNAT</application> tarball, and change to the
183 GNAT directory. Then, install the <application>GNAT</application> binary
184 by running the following command as the
185 <systemitem class="username">root</systemitem> user:
186 </para>
187
188<screen role="root"><userinput>make ins-all prefix=/opt/gnat</userinput></screen>
189
190 <para>
191 The <application>GNAT</application> compiler can be invoked by
192 executing the <command>gcc</command> binary installed in <filename
193 class="directory">/opt/gnat/bin</filename>.
194 </para>
195
196 <para>
197 You may now remove the <application>GNAT</application>
198 source directory if desired.
199 </para>
200
201 <para>
202 Prepare to compile <application>GCC</application> by placing the
203 <application>GNAT</application> version of <command>gcc</command> at the
204 beginning of the <envar>PATH</envar> variable by using the following
205 commands:
206 </para>
207
208<screen><userinput>PATH_HOLD=$PATH &amp;&amp;
209export PATH=/opt/gnat/bin:$PATH_HOLD</userinput></screen>
210
211 <para>
212 Doing so has the drawback that the <application>GCC</application>
213 and <application>Binutils</application> executables are taken
214 from the just installed <application>GNAT</application> package, but the
215 versions of those executables are outdated compared to those installed in
216 LFS. This is not important for the <application>GCC</application> compilers,
217 since they recompile themselves during the bootstrap process. On the other
218 hand, the outdated <command>ld</command> and <command>as</command> tools
219 are used all along. In order to use the LFS tools, issue as the
220 <systemitem class="username">root</systemitem> user:
221 </para>
222
223<screen role="root"><userinput>find /opt/gnat -name ld -exec mv -v {} {}.old \;
224find /opt/gnat -name as -exec mv -v {} {}.old \;</userinput></screen>
225
226 </sect2>
227
228 <sect2 role="installation">
229 <title>Installation of GCC Ada</title>
230
231 <para>
232 As in LFS, fix some problems identified upstream:
233 </para>
234
235<screen><userinput>patch -Np1 -i ../gcc-&gcc-version;-upstream_fixes-1.patch</userinput></screen>
236
237 <para>
238 Install <application>GCC Ada</application> by running the
239 following commands:
240 </para>
241
242<screen><userinput>mkdir ../gcc-build &amp;&amp;
243cd ../gcc-build &amp;&amp;
244
245../gcc-&gcc-version;/configure \
246 --prefix=/usr \
247 --disable-multilib \
248 --with-system-zlib \
249 --enable-languages=ada &amp;&amp;
250make</userinput></screen>
251
252 <para>
253 If you have installed additional packages such as
254 <application>Valgrind</application> and <application>GDB</application>,
255 the <application>GCC</application> part of the testsuite will run more
256 tests than in LFS. Some of those will report FAIL and others XPASS
257 (pass when expected to FAIL). To run the tests, issue:
258 </para>
259
260<screen><userinput>ulimit -s 32768 &amp;&amp;
261make -k check</userinput></screen>
262<!-- The command above may error out, so using && may prevent the summary
263to be run. -->
264
265 <para>
266 The tests are very long, and the results may be hard to find in the
267 logs, specially if you use parallel jobs with make. You can get a summary
268 of the tests with:
269 </para>
270
271<screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
272
273 <para>
274 Now, as the <systemitem class="username">root</systemitem> user:
275 </para>
276
277<screen role="root"><userinput>make install &amp;&amp;
278
279mkdir -pv /usr/share/gdb/auto-load/usr/lib &amp;&amp;
280mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib &amp;&amp;
281
282chown -v -R root:root \
283 /usr/lib/gcc/*linux-gnu/&gcc-version;/include{,-fixed} \
284 /usr/lib/gcc/*linux-gnu/&gcc-version;/ada{lib,include}</userinput></screen>
285
286 <para>
287 You should now remove the <application>GNAT</application>
288 installation and perform other cleanups. First, as the <systemitem
289 class="username">root</systemitem> user:
290 </para>
291
292<screen role="root"><userinput>rm -rf /opt/gnat</userinput></screen>
293
294 <para>
295 Then, as a normal user:
296 </para>
297
298<screen><userinput>export PATH=$PATH_HOLD &amp;&amp;
299unset PATH_HOLD</userinput></screen>
300
301 </sect2>
302
303 <sect2 role="commands">
304 <title>Command Explanations</title>
305
306 <para>
307 <command>mkdir ../gcc-build; cd ../gcc-build</command>: The
308 <application>GCC</application> documentation recommends
309 building the package in a dedicated build directory.
310 </para>
311
312 <para>
313 <parameter>--disable-multilib</parameter>: This parameter ensures
314 that files are created for the specific architecture of your computer.
315 </para>
316
317 <para>
318 <parameter>--with-system-zlib</parameter>: Uses the system
319 <application>zlib</application> instead of the bundled one.
320 <application>zlib</application> is used for compressing
321 and uncompressing <application>GCC</application>'s intermediate
322 language in LTO (Link Time Optimization) object files.
323 </para>
324
325 <para>
326 <parameter>--enable-languages=ada</parameter>: Instructs the build system
327 to build the Ada tools and compiler. It is unavoidable that the
328 <application>C</application> and <application>C++</application>
329 compilers be built too.
330 </para>
331
332 <para>
333 <option>--with-default-libstdcxx-abi=c++98</option>: Use this switch if you
334 are building <application>GNAT</application> tools using a
335 <application>GCC</application> version prior to 5.1.0,
336 and you do not want to recompile all the libraries written in C++.
337 </para>
338
339 <para>
340 <command>ulimit -s 32768</command>: This command prevents several
341 tests from running out of stack space.
342 </para>
343
344 <para>
345 <command>make -k check</command>: This command runs the test suite
346 without stopping if any errors are encountered.
347 </para>
348
349 <para>
350 <command>../gcc-&gcc-version;/contrib/test_summary</command>: This
351 command will produce a summary of the test suite results. You can append
352 <command>| grep -A7 Summ</command> to the command to produce an even more
353 condensed version of the summary. You may also wish to redirect the output
354 to a file for review and comparison later on.
355 </para>
356
357 <para>
358 <command>chown -v -R root:root /usr/lib/gcc/*linux-gnu/...</command>:
359 If the package is built by a user other than root, the ownership of the
360 installed <filename class="directory">include</filename> and
361 <filename class="directory">adalib</filename> directories (and their
362 contents) will be incorrect. These commands change the ownership to the
363 <systemitem class="username">root</systemitem> user and group.
364 </para>
365
366 </sect2>
367
368 <sect2 role="content">
369 <title>Contents</title>
370
371 <segmentedlist>
372 <segtitle>Installed Programs</segtitle>
373 <segtitle>Installed Libraries</segtitle>
374 <segtitle>Installed Directories</segtitle>
375
376 <seglistitem>
377 <seg>
378 gnat, gnatbind, gnatchop, gnatclean, gnatfind, gnatkr,
379 gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref
380 </seg>
381 <seg>
382 libgnat.{so,a}, libgnarl.{so,a} in <filename class="directory">
383 /usr/lib/gcc/&lt;arch-triplet&gt;/&gcc-version;/adalib</filename>
384 </seg>
385 <seg>
386 /usr/lib/gcc/&lt;arch-triplet&gt;/&gcc-version;/ada{include,lib}
387 </seg>
388 </seglistitem>
389 </segmentedlist>
390
391 <para>
392 Only the Ada specific files are listed here. Others can be found at
393 <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
394 initially installed during the building of LFS.
395 </para>
396
397 <variablelist>
398 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
399 <?dbfo list-presentation="list"?>
400 <?dbhtml list-presentation="table"?>
401
402 <varlistentry id="gnat">
403 <term><command>gnat</command></term>
404 <listitem>
405 <para>
406 is a wrapper that accepts a number of commands and calls
407 the corresponding tool from the list below.
408 </para>
409 <indexterm zone="gcc-ada gnat">
410 <primary sortas="b-gnat">gnat</primary>
411 </indexterm>
412 </listitem>
413 </varlistentry>
414
415 <varlistentry id="gnatbind">
416 <term><command>gnatbind</command></term>
417 <listitem>
418 <para>
419 is used to bind compiled objects.
420 </para>
421 <indexterm zone="gcc-ada gnatbind">
422 <primary sortas="b-gnatbind">gnatbind</primary>
423 </indexterm>
424 </listitem>
425 </varlistentry>
426
427 <varlistentry id="gnatchop">
428 <term><command>gnatchop</command></term>
429 <listitem>
430 <para>
431 is useful for renaming files to meet the standard
432 <application>Ada</application> default file naming conventions.
433 </para>
434 <indexterm zone="gcc-ada gnatchop">
435 <primary sortas="b-gnatchop">gnatchop</primary>
436 </indexterm>
437 </listitem>
438 </varlistentry>
439
440 <varlistentry id="gnatclean">
441 <term><command>gnatclean</command></term>
442 <listitem>
443 <para>
444 is used to remove files associated with a
445 <application>GNAT</application> project.
446 </para>
447 <indexterm zone="gcc-ada gnatclean">
448 <primary sortas="b-gnatclean">gnatclean</primary>
449 </indexterm>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry id="gnatfind">
454 <term><command>gnatfind</command></term>
455 <listitem>
456 <para>
457 is intended for locating definition and/or references to
458 specified entities in a <application>GNAT</application> project.
459 </para>
460 <indexterm zone="gcc-ada gnatfind">
461 <primary sortas="b-gnatfind">gnatfind</primary>
462 </indexterm>
463 </listitem>
464 </varlistentry>
465
466 <varlistentry id="gnatkr">
467 <term><command>gnatkr</command></term>
468 <listitem>
469 <para>
470 is used to determine the crunched name for a given file, when
471 crunched to a specified maximum length.
472 </para>
473 <indexterm zone="gcc-ada gnatkr">
474 <primary sortas="b-gnatkr">gnatkr</primary>
475 </indexterm>
476 </listitem>
477 </varlistentry>
478
479 <varlistentry id="gnatlink">
480 <term><command>gnatlink</command></term>
481 <listitem>
482 <para>
483 is used to link programs and build an executable file.
484 </para>
485 <indexterm zone="gcc-ada gnatlink">
486 <primary sortas="b-gnatlink">gnatlink</primary>
487 </indexterm>
488 </listitem>
489 </varlistentry>
490
491 <varlistentry id="gnatls">
492 <term><command>gnatls</command></term>
493 <listitem>
494 <para>
495 is the compiled unit browser.
496 </para>
497 <indexterm zone="gcc-ada gnatls">
498 <primary sortas="b-gnatls">gnatls</primary>
499 </indexterm>
500 </listitem>
501 </varlistentry>
502
503 <varlistentry id="gnatmake">
504 <term><command>gnatmake</command></term>
505 <listitem>
506 <para>
507 is the <application>Ada</application> compiler, which performs
508 compilaton, binding and linking.
509 </para>
510 <indexterm zone="gcc-ada gnatmake">
511 <primary sortas="b-gnatmake">gnatmake</primary>
512 </indexterm>
513 </listitem>
514 </varlistentry>
515
516 <varlistentry id="gnatname">
517 <term><command>gnatname</command></term>
518 <listitem>
519 <para>
520 will list the files associated with a
521 <application>GNAT</application> project.
522 </para>
523 <indexterm zone="gcc-ada gnatname">
524 <primary sortas="b-gnatname">gnatname</primary>
525 </indexterm>
526 </listitem>
527 </varlistentry>
528
529 <varlistentry id="gnatprep">
530 <term><command>gnatprep</command></term>
531 <listitem>
532 <para>
533 is the <application>GNAT</application> external preprocessor.
534 </para>
535 <indexterm zone="gcc-ada gnatprep">
536 <primary sortas="b-gnatprep">gnatprep</primary>
537 </indexterm>
538 </listitem>
539 </varlistentry>
540
541 <varlistentry id="gnatxref">
542 <term><command>gnatxref</command></term>
543 <listitem>
544 <para>
545 is similar to <command>gnatfind</command>, but generates
546 a full report of all cross-references.
547 </para>
548 <indexterm zone="gcc-ada gnatxref">
549 <primary sortas="b-gnatxref">gnatxref</primary>
550 </indexterm>
551 </listitem>
552 </varlistentry>
553
554 </variablelist>
555
556 </sect2>
557
558</sect1>
Note: See TracBrowser for help on using the repository browser.