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

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 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 ab98f0ce was ab98f0ce, checked in by DJ Lucas <dj@…>, 7 years ago

Fix installation of GCC-Ada libs and headers due to broken Makefile.

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

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