source: archive/gcc-ada.xml@ 0a4d6ef0

10.0 10.1 11.0 9.0 9.1 qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 0a4d6ef0 was 0a4d6ef0, checked in by Douglas R. Reno <renodr@…>, 3 years ago

Archive gcc-ada

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

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