1 |
george 07/10/05 20:51:32 |
2 |
|
3 |
Modified: dev_reference.xml |
4 |
Log: |
5 |
some more contents, divided topics by chapters |
6 |
|
7 |
Revision Changes Path |
8 |
1.3 xml/htdocs/proj/en/prog_lang/ada/dev_reference.xml |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/prog_lang/ada/dev_reference.xml?rev=1.3&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/prog_lang/ada/dev_reference.xml?rev=1.3&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/prog_lang/ada/dev_reference.xml?r1=1.2&r2=1.3 |
13 |
|
14 |
Index: dev_reference.xml |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo/xml/htdocs/proj/en/prog_lang/ada/dev_reference.xml,v |
17 |
retrieving revision 1.2 |
18 |
retrieving revision 1.3 |
19 |
diff -u -r1.2 -r1.3 |
20 |
--- dev_reference.xml 29 Sep 2007 20:20:19 -0000 1.2 |
21 |
+++ dev_reference.xml 5 Oct 2007 20:51:32 -0000 1.3 |
22 |
@@ -44,22 +44,24 @@ |
23 |
<dt><b>Ada libraries</b></dt> |
24 |
<dd> |
25 |
These are built for every installed gnat and profile-dependent files are |
26 |
- installed to profile specific dirs, similarly to those of gnat, however they |
27 |
- go in a "library place". This is handled automatically by gnat.eclass, inner |
28 |
+ installed to profile specific dirs, similarly to those of gnat, except that they |
29 |
+ go in a "library place". This is handled automatically by <c>gnat.eclass</c>, inner |
30 |
workings of which are discussed below. |
31 |
</dd> |
32 |
<dt><b>Executables/other programs</b></dt> |
33 |
- <dd>The stuff that is to be executed directly or otherwise is not supposed to be linked |
34 |
- against. The prominent examples would be gps, c2ada, etc. These require no special |
35 |
- treatment and can be built in a regular way with any active compiler or can |
36 |
- depend on a particular variant. One particular issue should be observed however. |
37 |
- If the execuables link against any of the |
38 |
- profile-specific Ada libraries, when user switches gnat profile the particular |
39 |
- binary versions of these libs will become unavailable. In fact, the linker will |
40 |
- attempt to select the library by name and will try to link against the binary |
41 |
- incompatible variant, resulting in execution failure. To resolve this, such binaries |
42 |
- should be compiled with LD_RUN_PATH defined and containing the locations of the |
43 |
- needed variants of the libs. |
44 |
+ <dd> |
45 |
+ The stuff that is to be executed directly or otherwise is not supposed to be linked |
46 |
+ against. The prominent examples would be <c>gps</c>, <c>c2ada</c>, etc. |
47 |
+ These require no special |
48 |
+ treatment and can be built in a regular way with any active compiler or can |
49 |
+ depend on a particular variant. One particular issue should be observed however. |
50 |
+ If the execuables link against any of the |
51 |
+ profile-specific Ada libraries, when user switches gnat profile the particular |
52 |
+ binary versions of these libs will become unavailable. In fact, the linker will |
53 |
+ attempt to select the library by name and will try to link against the binary |
54 |
+ incompatible variant, resulting in execution failure. To resolve this, such binaries |
55 |
+ should be compiled with <c>LD_RUN_PATH</c> defined and containing the locations of the |
56 |
+ needed variants of the libs. |
57 |
</dd> |
58 |
</dl> |
59 |
<p> |
60 |
@@ -69,9 +71,14 @@ |
61 |
</p> |
62 |
</body> |
63 |
</section> |
64 |
+ </chapter> |
65 |
+ |
66 |
+ |
67 |
+ <chapter> |
68 |
+ <title>gnatbuild.eclass and eselect-gnat</title> |
69 |
|
70 |
<section> |
71 |
- <title>gnatbuild.eclass and eselect-gnat</title> |
72 |
+ <title>General notes.</title> |
73 |
<body> |
74 |
<p> |
75 |
The <c>gnatbuildeclass</c> has been modelled after the <c>toolchain.eclass</c>, |
76 |
@@ -87,9 +94,98 @@ |
77 |
It is possible they change it again to GPL-3 and FSF will likely want to do so as well. |
78 |
Therefore attention needs to be paid to the licenses when these packages are updated. |
79 |
</p> |
80 |
+ |
81 |
+ <p> |
82 |
+ <c>gnat</c> (both versions) can be considered a "yet another gcc frontend", therefore |
83 |
+ it is built similarly to other <c>gcc</c> based languages. There is, however, a significant |
84 |
+ distinction. It may be argued, that Ada is a "real language", in the sense that it |
85 |
+ requires an Ada-enabled compiler to build itself. This makes the build procedure |
86 |
+ significantly different from, e.g., <c>gpc</c> or <c>gdc</c> in that we first |
87 |
+ need to provide a bootstrap compiler and then setup a bootstrap environment. |
88 |
+ In practice, the bootstraps need to be created only once, as <c>gcc</c> (and <c>gnat</c>) |
89 |
+ internally |
90 |
+ build itself twice (stage1 and stage2) and then build the final binary and libs with |
91 |
+ stage2. Plus, so far, all the new versions of gcc could be built with the oldest at that time |
92 |
+ backend of gnat - 3.4. If, however, a version of <c>gcc</c> is released that cannot |
93 |
+ be built with an old bootstrap (for example, the transition from 2.8 to the later versions |
94 |
+ was problemmatic), a new one may need to be issued. |
95 |
+ </p> |
96 |
+ |
97 |
+ <p> |
98 |
+ If you take a look at the <c>src_compile</c>, you will notice that all the code dealing |
99 |
+ with running <c>configure</c> and <c>make</c> is preceded by the block setting many |
100 |
+ env vars. Such as (here and everywhere you can refere to the appropriate eclass or ebuild |
101 |
+ in portage to see all of the code): |
102 |
+ </p> |
103 |
+ <pre caption="Setting up bootstrap environment in gnatbuild.eclass"> |
104 |
+ <comment> # Set some paths to our bootstrap compiler.</comment> |
105 |
+ export <ident>PATH</ident>=<const>"${GNATBOOT}/bin:${PATH}"</const> |
106 |
+ <comment># !ATTN! the *installed* compilers have ${PN} as part of their |
107 |
+ # LIBPATH, while the *bootstrap* uses hardset "gnatgcc" in theirs |
108 |
+ # (which is referenced as GNATLIB below)</comment> |
109 |
+ <ident>GNATLIB</ident>=<const>"${GNATBOOT}/lib/gnatgcc/${BOOT_TARGET}/${BOOT_SLOT}"</const> |
110 |
+ |
111 |
+ export CC="${GNATBOOT}/bin/gnatgcc" |
112 |
+ export INCLUDE_DIR="${GNATLIB}/include" |
113 |
+ export LIB_DIR="${GNATLIB}" |
114 |
+ export LDFLAGS="-L${GNATLIB}" |
115 |
+ ... |
116 |
+ </pre> |
117 |
+ |
118 |
+ <p> |
119 |
+ These setting serve the purpose of letting the gnat build scripts find the bootstrap |
120 |
+ compiler, so that we do not have to depend on having some version of Ada-enabled |
121 |
+ <c>gcc</c> already installed on the system. While pretty plain, this part may get somewhat |
122 |
+ tricky. What vars you need to set or avoid depends on the version of toolchain |
123 |
+ the build host has active. The most "abusive" package in the toolchain was traditionally |
124 |
+ <c>binutils</c>. In fact there were many bugs reporting build failures with <c>configure</c> |
125 |
+ complaining that <c>CC</c> is |
126 |
+ unable to find <c>collect1</c> or some other part of the bootstrap compiler. The most |
127 |
+ common cause of these bugs was related to an old version of <c>binutils</c> having been |
128 |
+ installed on user's computer. Correspondingly, it was necessary to force gnat to depend |
129 |
+ on a appropriately recent version of <c>binutils</c>. Fortunately, it seems that toolschain |
130 |
+ has largerly stabilized in the last year or so, as this has not been necessary for |
131 |
+ quite a while. |
132 |
+ </p> |
133 |
+ |
134 |
+ |
135 |
+ <p> |
136 |
+ </p> |
137 |
+ </body> |
138 |
+ </section> |
139 |
+ |
140 |
+ <section> |
141 |
+ <title>Install locations</title> |
142 |
+ <body> |
143 |
+ <p> |
144 |
+ To be completed. |
145 |
+ </p> |
146 |
+ </body> |
147 |
+ </section> |
148 |
+ |
149 |
+ <section> |
150 |
+ <title>eselect-gnat workings</title> |
151 |
+ <body> |
152 |
+ <p> |
153 |
+ To be completed. |
154 |
+ </p> |
155 |
</body> |
156 |
</section> |
157 |
</chapter> |
158 |
+ |
159 |
+ |
160 |
+ <chapter> |
161 |
+ <title>gnat.eclass and libraries</title> |
162 |
+ <section> |
163 |
+ <title>Overview</title> |
164 |
+ <body> |
165 |
+ <p> |
166 |
+ To be completed. |
167 |
+ </p> |
168 |
+ </body> |
169 |
+ </section> |
170 |
+ </chapter> |
171 |
+ |
172 |
</guide> |
173 |
|
174 |
<!-- vim: set tabstop=2: --> |
175 |
|
176 |
|
177 |
|
178 |
-- |
179 |
gentoo-commits@g.o mailing list |