source: general/prog/gcc-ada.xml@ 07499ecc

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt 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 07499ecc was 51cb7cd, checked in by DJ Lucas <dj@…>, 6 years ago

Update to gdb-8.1.1. Fixes 10981.

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

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