source: general/prog/gcc-ada.xml@ a110c7f7

perl-modules
Last change on this file since a110c7f7 was 3e82eae, checked in by Douglas R. Reno <renodr@…>, 6 years ago

Last minute change to disable libmpx in GCC

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

  • Property mode set to 100644
File size: 19.1 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 instructions 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 --disable-libmpx \
258 --with-system-zlib \
259 --enable-languages=ada &amp;&amp;
260make</userinput></screen>
261
262 <para>
263 If you have installed additional packages such as
264 <application>Valgrind</application> and <application>GDB</application>,
265 the <application>GCC</application> part of the testsuite will run more
266 tests than in LFS. Some of those will report FAIL and others XPASS
267 (pass when expected to FAIL). To run the tests, issue:
268 </para>
269
270<screen><userinput>ulimit -s 32768 &amp;&amp;
271make -k check</userinput></screen>
272<!-- The command above may error out, so using && may prevent the summary
273to be run. -->
274
275 <para>
276 The tests are very long, and the results may be hard to find in the
277 logs, specially if you use parallel jobs with make. You can get a summary
278 of the tests with:
279 </para>
280
281<screen><userinput>../contrib/test_summary</userinput></screen>
282
283 <para>
284 Now, as the <systemitem class="username">root</systemitem> user:
285 </para>
286
287<screen role="root"><userinput>make install &amp;&amp;
288mkdir -pv /usr/share/gdb/auto-load/usr/lib &amp;&amp;
289mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib &amp;&amp;
290
291chown -v -R root:root \
292 /usr/lib/gcc/*linux-gnu/&gcc-ada-version;/include{,-fixed} \
293 /usr/lib/gcc/*linux-gnu/&gcc-ada-version;/ada{lib,include}</userinput></screen>
294
295 <para>
296 You should now remove the <application>GNAT</application>
297 installation and perform other cleanups. First, as the <systemitem
298 class="username">root</systemitem> user:
299 </para>
300
301<screen role="root"><userinput>rm -rf /opt/gnat</userinput></screen>
302
303 <para>
304 Then, as a normal user:
305 </para>
306
307<screen><userinput>export PATH=$PATH_HOLD &amp;&amp;
308unset PATH_HOLD</userinput></screen>
309
310 </sect2>
311
312 <sect2 role="commands">
313 <title>Command Explanations</title>
314
315 <para>
316 <command>mkdir build; cd build</command>: The
317 <application>GCC</application> documentation recommends
318 building the package in a dedicated build directory.
319 </para>
320
321 <para>
322 <parameter>--disable-multilib</parameter>: This parameter ensures
323 that files are created for the specific architecture of your computer.
324 </para>
325
326 <para>
327 <parameter>--with-system-zlib</parameter>: Uses the system
328 <application>zlib</application> instead of the bundled one.
329 <application>zlib</application> is used for compressing
330 and uncompressing <application>GCC</application>'s intermediate
331 language in LTO (Link Time Optimization) object files.
332 </para>
333
334 <para>
335 <parameter>--enable-languages=ada</parameter>: Instructs the build system
336 to build the Ada tools and compiler. It is unavoidable that the
337 <application>C</application> and <application>C++</application>
338 compilers be built too.
339 </para>
340
341 <para>
342 <option>--with-default-libstdcxx-abi=gcc4-compatible</option>: Use this
343 switch if you are building <application>GNAT</application> tools using a
344 <application>GCC</application> version prior to 5.1.0,
345 and you do not want to recompile all the libraries written in C++.
346 </para>
347
348 <para>
349 <command>ulimit -s 32768</command>: This command prevents several
350 tests from running out of stack space.
351 </para>
352
353 <para>
354 <command>make -k check</command>: This command runs the test suite
355 without stopping if any errors are encountered.
356 </para>
357
358 <para>
359 <command>../contrib/test_summary</command>: This
360 command will produce a summary of the test suite results. You can append
361 <command>| grep -A7 Summ</command> to the command to produce an even more
362 condensed version of the summary. You may also wish to redirect the output
363 to a file for review and comparison later on.
364 </para>
365
366 <para>
367 <command>chown -v -R root:root /usr/lib/gcc/*linux-gnu/...</command>:
368 If the package is built by a user other than root, the ownership of the
369 installed <filename class="directory">include</filename> and
370 <filename class="directory">adalib</filename> directories (and their
371 contents) will be incorrect. These commands change the ownership to the
372 <systemitem class="username">root</systemitem> user and group.
373 </para>
374
375 </sect2>
376
377 <sect2 role="content">
378 <title>Contents</title>
379
380 <segmentedlist>
381 <segtitle>Installed Programs</segtitle>
382 <segtitle>Installed Libraries</segtitle>
383 <segtitle>Installed Directories</segtitle>
384
385 <seglistitem>
386 <seg>
387 gnat, gnatbind, gnatchop, gnatclean, gnatfind, gnatkr,
388 gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref
389 </seg>
390 <seg>
391 libgnarl.{so,a}, libgnat.{so,a} in <filename class="directory">
392 /usr/lib/gcc/&lt;arch-triplet&gt;/&gcc-ada-version;/adalib</filename>
393 </seg>
394 <seg>
395 /usr/lib/gcc/&lt;arch-triplet&gt;/&gcc-ada-version;/ada{include,lib}
396 and /usr/lib/gcc/&lt;arch-triplet&gt;/&gcc-ada-version;/plugin/include/ada
397 </seg>
398 </seglistitem>
399 </segmentedlist>
400
401 <para>
402 Only the Ada specific files are listed here. Others can be found at
403 <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
404 initially installed during the building of LFS.
405 </para>
406
407 <variablelist>
408 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
409 <?dbfo list-presentation="list"?>
410 <?dbhtml list-presentation="table"?>
411
412 <varlistentry id="gnat">
413 <term><command>gnat</command></term>
414 <listitem>
415 <para>
416 is a wrapper that accepts a number of commands and calls
417 the corresponding tool from the list below.
418 </para>
419 <indexterm zone="gcc-ada gnat">
420 <primary sortas="b-gnat">gnat</primary>
421 </indexterm>
422 </listitem>
423 </varlistentry>
424
425 <varlistentry id="gnatbind">
426 <term><command>gnatbind</command></term>
427 <listitem>
428 <para>
429 is used to bind compiled objects.
430 </para>
431 <indexterm zone="gcc-ada gnatbind">
432 <primary sortas="b-gnatbind">gnatbind</primary>
433 </indexterm>
434 </listitem>
435 </varlistentry>
436
437 <varlistentry id="gnatchop">
438 <term><command>gnatchop</command></term>
439 <listitem>
440 <para>
441 is useful for renaming files to meet the standard
442 <application>Ada</application> default file naming conventions.
443 </para>
444 <indexterm zone="gcc-ada gnatchop">
445 <primary sortas="b-gnatchop">gnatchop</primary>
446 </indexterm>
447 </listitem>
448 </varlistentry>
449
450 <varlistentry id="gnatclean">
451 <term><command>gnatclean</command></term>
452 <listitem>
453 <para>
454 is used to remove files associated with a
455 <application>GNAT</application> project.
456 </para>
457 <indexterm zone="gcc-ada gnatclean">
458 <primary sortas="b-gnatclean">gnatclean</primary>
459 </indexterm>
460 </listitem>
461 </varlistentry>
462
463 <varlistentry id="gnatfind">
464 <term><command>gnatfind</command></term>
465 <listitem>
466 <para>
467 is intended for locating definition and/or references to
468 specified entities in a <application>GNAT</application> project.
469 </para>
470 <indexterm zone="gcc-ada gnatfind">
471 <primary sortas="b-gnatfind">gnatfind</primary>
472 </indexterm>
473 </listitem>
474 </varlistentry>
475
476 <varlistentry id="gnatkr">
477 <term><command>gnatkr</command></term>
478 <listitem>
479 <para>
480 is used to determine the crunched name for a given file, when
481 crunched to a specified maximum length.
482 </para>
483 <indexterm zone="gcc-ada gnatkr">
484 <primary sortas="b-gnatkr">gnatkr</primary>
485 </indexterm>
486 </listitem>
487 </varlistentry>
488
489 <varlistentry id="gnatlink">
490 <term><command>gnatlink</command></term>
491 <listitem>
492 <para>
493 is used to link programs and build an executable file.
494 </para>
495 <indexterm zone="gcc-ada gnatlink">
496 <primary sortas="b-gnatlink">gnatlink</primary>
497 </indexterm>
498 </listitem>
499 </varlistentry>
500
501 <varlistentry id="gnatls">
502 <term><command>gnatls</command></term>
503 <listitem>
504 <para>
505 is the compiled unit browser.
506 </para>
507 <indexterm zone="gcc-ada gnatls">
508 <primary sortas="b-gnatls">gnatls</primary>
509 </indexterm>
510 </listitem>
511 </varlistentry>
512
513 <varlistentry id="gnatmake">
514 <term><command>gnatmake</command></term>
515 <listitem>
516 <para>
517 is the <application>Ada</application> compiler, which performs
518 compilation, binding and linking.
519 </para>
520 <indexterm zone="gcc-ada gnatmake">
521 <primary sortas="b-gnatmake">gnatmake</primary>
522 </indexterm>
523 </listitem>
524 </varlistentry>
525
526 <varlistentry id="gnatname">
527 <term><command>gnatname</command></term>
528 <listitem>
529 <para>
530 will list the files associated with a
531 <application>GNAT</application> project.
532 </para>
533 <indexterm zone="gcc-ada gnatname">
534 <primary sortas="b-gnatname">gnatname</primary>
535 </indexterm>
536 </listitem>
537 </varlistentry>
538
539 <varlistentry id="gnatprep">
540 <term><command>gnatprep</command></term>
541 <listitem>
542 <para>
543 is the <application>GNAT</application> external preprocessor.
544 </para>
545 <indexterm zone="gcc-ada gnatprep">
546 <primary sortas="b-gnatprep">gnatprep</primary>
547 </indexterm>
548 </listitem>
549 </varlistentry>
550
551 <varlistentry id="gnatxref">
552 <term><command>gnatxref</command></term>
553 <listitem>
554 <para>
555 is similar to <command>gnatfind</command>, but generates
556 a full report of all cross-references.
557 </para>
558 <indexterm zone="gcc-ada gnatxref">
559 <primary sortas="b-gnatxref">gnatxref</primary>
560 </indexterm>
561 </listitem>
562 </varlistentry>
563
564 </variablelist>
565
566 </sect2>
567
568</sect1>
Note: See TracBrowser for help on using the repository browser.