Second Edition (2006-03-17)
Copyright © 2004, 2005 Ludovic Brenta <ludovic@ludovic-brenta.org>
This document is free; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
This document describes all there is to know about Ada in Debian. Most of it contains my personal thoughts and opinions, although I try to get the facts straight. I would appreciate it if you could send me corrections or additions at ludovic@ludovic-brenta.org.
After posting the first draft, I received numerous comments to improve this document. In particular, I would like to thank Dan Eilers of Irvine Compiler Corporation for providing me with details about GCC. Other contributors include Simon Wright, Ed Falis, Georg Bauhaus, and Bob Rogers.
Each chapter and appendix in this Policy is either informative or normative. Normative chapters contain binding rules that all packages compiled from Ada sources must follow; informative chapters only contain useful information.
(This chapter is informative)
This chapter gives information about GNAT, the free Ada compiler.
GNAT originally started as the GNU New-York University Ada Translator in 1994. Under a contract with the US Department of Defense, a team at NYU started writing GNAT as a reference implementation of the upcoming Ada 95 ISO standard. The grant contract mandated the use of the GNU General Public Licence for the compiler.
After the Ada 95 standard was published, various corporations and DoD services started using GNAT in mission-critical projects, and asked for support. The original authors of GNAT then left New-York University to form AdaCore. Today, AdaCore has offices in New York (http://www.adacore.com) and Paris (http://www.adacore.fr). GNAT is still free software under the GPL. AdaCore offers commercial support for it, and continues development.
Over the years, several institutions contributed software to complement GNAT. For example, the Ecole Nationale Superieure de Telecommunications in Paris contributed GLADE, an implementation of Annex E (Distributed Systems) for GNAT. Most of these contributions are also supported commercially by AdaCore, and are distributed together with GNAT to supported customers. As a result, the GNAT acronym now stands for GNU Ada Technology.
There are several places to get GNAT from, and different GNATs which, for lack of a better word, I call “variants”. Each has a different binary interface from the others; it is therefore not possible to link object files produced by different variants into an executable; nor is it possible to link an executable produced by one variant with libraries produced by another.
This policy aims to make it straightforward to link various libraries into a single executable. To achieve this, it is necessary to select one compiler for all Debian packages.
Here are descriptions of the variants of GNAT:
The GNAT-Modified GPL is the GPL with the following text added to each source file:
“As a special exception, if other files instantiate generics from this unit, or you link this unit with other files to produce an executable, this unit does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.”
Thus, the GNAT-Modified GPL permits the distribution of proprietary software linked with the GNAT run-time library, libgnat. The pure GPL disallows this, as any binary linked with a GPL library must also be distributed under GPL, or not at all. This does not apply to your source text: your source program is not linked with libgnat, therefore you can distribute it under whichever licensing terms you choose, even non-disclosure agreements.
| Announced | Release | Based on | gnatgcc -v
|
| 2003-02-18 | 3.16a | GCC 2.8.1 | 2003-01-20
|
| 2003-07-01 | 3.16a1 | GCC 2.8.1 | 2003-06-20
|
| 2003-08-21 | 5.01a | GCC 3.2.3 | 2003-08-08
|
| 2004-02-26 | 5.02a | GCC 3.2.3 | 2004-01-16
|
| 2005-02-21 | 5.03a | GCC 3.4.1 | 2005-01-14
|
| 2006-01-30 | 5.04 | GCC 3.4.4 | 2006-01-30
|
In addition to these full releases, supported customers sometimes receive a “wavefront” release, with “w” in their version number, e.g. 5.02w. As the name suggests, the “wavefront” changes constantly as GNAT evolves.
The dates in this timeline are the timestamps of the source files for each release, as stored in the tar.gz archive. These dates sometimes differ from the hardcoded “release date” which is visible with “gnatgcc -v”.
| Date | Release | Based on: | gnatgcc -v
|
| 1995-11-29 | 3.01p | GCC 2.7.2 | none
|
| 1996-05-03 | 3.04p | GCC 2.7.2 | none
|
| 1996-06-07 | 3.05p | GCC 2.7.2 | 1996-06-07
|
| 1996-10-23 | 3.07p | GCC 2.7.2 | 1996-10-23
|
| 1997-01-21 | 3.09p | GCC 2.7.2 | 1997-01-21
|
| 1997-08-14 | 3.10p | GCC 2.7.2 | 1997-08-14
|
| 1998-12-18 | 3.11p | GCC 2.8.1 | 1998-11-18
|
| 1999-09-24 | 3.12p | GCC 2.8.1 | 1999-06-29
|
| 2000-07-19 | 3.13p | GCC 2.8.1 | 2000-05-09
|
| 2001-10-07 | 3.14p | GCC 2.8.1 | 2001-05-03
|
| 2002-10-24 | 3.15p | GCC 2.8.1 | 2002-05-23
|
| 2005-09-15 | 2005 | GCC 3.4.4 | 2005-05-24
|
The GNAT GPL 2005 Edition changes the licensing terms of the run-time library to the pure GPL, thereby disallowing the distribution of non-GPL programs linked with this Edition's run-time library. The Ada part in this Edition is different from that of both GCC 3.4 and GCC 4.0 discussed below; I understand that is is roughly similar to GNAT Pro 5.03a.
The GNAT Academic Programme started in 2004. Under this Programme, AdaCore made GNAT Pro available at no cost to registered academics. On top of this, professors received support from AdaCore at no cost. The GAP releases came with the full complement of tools and libraries then current for paying customers, all under GMGPL.
GAP 1.0 was based around GNAT Pro 5.01a.
GAP 1.1 was based around GNAT Pro 5.02a.
GAP 2005 changed the licensing terms to the pure GPL; it was based around GNAT Pro 5.03a.
As I understand it, GNAT GPL 2005 Edition is basically the same thing as GAP 2005, but without support.
In October 2001, AdaCore contributed their most recent GNAT Pro source code for the Ada 95 front-end and runtime library to the GCC source repository. The first release of GCC that included GNAT was 3.1 in May 2002. After that, little activity took place on the Ada parts of GCC; thus, GCC 3.1, 3.2 and 3.3 contain essentially the same Ada front-end and library.
In October 2003, after the second merge of GNAT Pro into GCC, AdaCore closed their own public CVS server, and started doing routine commits to the FSF's repository. Now, the HEAD of the CVS repository is constantly kept in sync with AdaCore's internal repository, which they use for support.
AdaCore only work on the main line of development; this means that no, or very few changes take place in minor versions of GCC, and I don't show them in the table below.
| 2001-10-01 | First merge into GCC
|
| 2002-05-22 | 3.1
|
| 2002-08-14 | 3.2
|
| 2003-05-13 | 3.3
|
| 2003-10-21 | Second merge into GCC
|
| 2004-04-18 | 3.4
|
| 2005-04-20 | 4.0
|
| 2006-02-28 | 4.1
|
GCC 3.4 has several new packages in the GNAT library, most notably a first version of the Ada 2005 container library, and also the “limited with” feature which will be part of Ada 2005. It also benefits from the new targets introduced in recent versions of GCC, such as AMD64. There are approximately 70 bug fixes relative to GCC 3.3.
However, it also has a serious regression: it does not support tasking
on powerpc-*-linux (see
ada/13897).
A subset of ACATS 2.5 (basically the executable tests, but not the tests with intentional errors) is included in GCC 3.4 and later. GCC 3.4 passes all of these tests.
GCC 4.0's Ada front-end restores tasking on powerpc, fixes about 100 bugs, and contains a newer version of the container library. One very major change inside GCC 4.0 warranted the new major version number. This change, called “tree-SSA”, is a new infrastructure for optimisers, and a new interface between front-ends and the back-end of the compiler. This required updating all the language front-ends. Unfortunately, these changes introduced some bugs too, including a few ACATS failures.
GCC 4.1's Ada front-end contains a further 60 bug fixes, brings the Ada.Containers library closer to the definitive Ada 2005 standard, and has a more mature interface to Tree-SSA. The entire ACATS passes in this release.
ASIS is the Ada Semantic Interface Specification. GNAT conforms to this Specification, and exposes the parse tree of programs, so that other programs can query and manipulate the parse tree. The ASIS distribution comes with several such programs, for example “gnatpp” a pretty-printer, or “gnatelim” which eliminates unused subprograms. Third-party programs that take advantage of ASIS include the “gch” and “adastyle” style checkers, “adabrowse” the document generator, “adasubst” which does mass substitutions of identifier names, and “adadep” which manages dependencies between compilation units.
GLADE is the Ecole Nationale de Telecommunications' implementation of the Distributed Systems annex (Annex E) of the Ada standard. With GLADE, it is possible to write a set of programs that run on different machines and communicate by means of remote procedure calls and shared objects. In Ada parlance, these programs are called “partitions” and the entire system is the “program”.
Florist is Florida State University's implementation of POSIX.5 standard, which allows Ada programs to use POSIX system services such as shared memory, pipes, and message queues.
All GNAT Pro, GAP and “p” releases of GNAT come with ASIS, GLADE and Florist; so does GNAT GPL 2005 Edition. In contrast, FSF releases come with none of them.
Because three years passed between GNAT 3.15p and GNAT GPL 2005 Edition, and no updates to ASIS or GLADE were released in that interval, Martin Krischik started projects on SourceForge to port ASIS, GLADE and Florist to FSF releases of GCC.
ASIS is at http://gnat-asis.sourceforge.net/
GLADE is at http://gnat-glade.sourceforge.net/ (project is dead)
FLORIST is at http://gnat-florist.sourceforge.net/
A couple of months after Martin started his SourceForge project, AdaCore published their CVS repository for GLADE; it is now at http://libre.act-europe.fr/glade/.
Martin has released ASIS for GCC 3.3, 3.4 and 4.0 independently from AdaCore.
Porting GLADE to newer releases of GCC requires intimate knowledge of the compiler's internals.
Because debugging information is in a standard format in object files, you can use GDB to debug programs written in any language. However, special Ada support allows GDB to demangle names and to understand Ada syntax when displaying variables.
GNAT 3.15p comes with a patched GDB 4.17 which understands Ada.
In 2003, AdaCore released a similarly patched GDB 5.3 which understands Ada; this is the one shipped as part of Debian 3.1 “Sarge”.
In GCC 3.4, the default format for debugging information changed from STABS to DWARF2. This change breaks compatibility with GDB 5.3; it is possible to force GCC to use the old STABS format by compiling with the `-gstabs+' option, like this:
`gnatmake -gstabs+ my_program'
As part of the GNAT GPL 2005 Edition (2005-09-15), AdaCore released an updated patch to GDB 5.3 and also a new patch to GDB 6.3, which understands DWARF2 natively.
Ada, as an ISO standard, undergoes at least one review every 5 years. The timeline of past standards is as follows:
| 1980 | MIL-STD-1815
|
| 1983 | ANSI/MIL-STD-1815A
|
| 1987 | Ada 83: ISO/8652:1987
|
| 1995 | Ada 95: ISO/8652:1995
|
| 2001 | Ada 95 Technical Corrigendum
|
There is a validation suite for Ada, called ACATS (Ada Conformity Assessment Test Suite). The current version, 2.5, is effective since 2002-04-01.
The ISO standard is being reviewed now. This process will result in a new version, with major changes to the language. All changes were frozen in 2005, but, as of March 2006, work is still ongoing to finalise the standard and publish it. Final publication is expected in 2006 or 2007.
(This chapter is normative.)
Rule: Package `gnat' is the default Ada compiler for Debian. All packages containing Ada programs or libraries SHALL use this compiler.
Rationale: This allows all programs and libraries to use the same ABI, so we can link them together.
Additional information: The default Ada compiler for Debian is as follows. Some versions of Debian provide alternative versions of GNAT. These alternative versions are for experimental purposes only; they receive no support, and Debian packages may not build-depend on any of them.
| Debian release | Default Ada compiler | Alternatives | Supported Platforms
|
| 2.0 Ham | GNAT 3.07 | i386
| |
| 2.1 Slink | GNAT 3.10p | i386
| |
| 2.2 Potato | GNAT 3.12p | i386
| |
| 3.0 Woody | GNAT 3.14p | i386, powerpc, sparc
| |
| 3.1 Sarge | GNAT 3.15p | gnat-3.3, gnat-3.4 | i386, powerpc, sparc
|
| Etch | GCC 4.1 | amd64, hppa, hppa64, i386, ia64, kfreebsd-i386, powerpc, ppc64, sparc, sparc64
|
(This section is informative.)
In this section, I will lay out my policy for Ada libraries. This is mostly interesting if you want to package additional libraries. I would be delighted to hear from you if you contemplate packaging Ada things for Debian, and I can help you get started.
If you only want to use libraries, see Using shared libraries.
The goal of this policy is to make Debian a robust and complete development platform for Ada programmers. This platform should appeal both to seasoned programmers and beginners. The basic tenet is that it Just Works.
This policy is based on the GNU Ada Environment Specification as far as is reasonable. This specification is an attempt by Florian Weimer to make all libraries install files in consistent places.
The GNAE is distribution-agnostic; it mandates a mechanism (similar to GNOME's pkg-config) to retrieve compiler switches for each library in a uniform way. However, thanks to GNAT project files, this is unnecessary; and Debian's packaging system handles dependencies. So, what follows is a stripped-down version of the GNAE suitable for Debian.
(This section is informative.)
For some libraries, the upstream authors provide a Makefile that does not compile all of the source files of the library; in particular, some upstream Makefiles do not compile all generic bodies. These upstream authors assume one of the following:
gnatmake -i.
gnatmake -I.
However, in Debian, none of the above applies. If the Debian maintainer were to use such Makefiles, and installed the *.ali files in /usr/lib/ada/adalib/LIBRARY, then some *.ali files would be missing. This would be a problem for non-root users, because they are not allowed to write *.ali files in /usr/lib/ada/adalib/LIBRARY. To prevent this, it is sometimes necessary for the Debian package maintainer to bypass upstream's Makefile with a scheme that ensures that all files are compiled. Here is a snippet from debian/rules that demonstrates how to do this:
build-stamp: build
build: configure static-lib shared-lib doc
touch build-stamp
debian/tmp:
dh_testdir
-mkdir -p debian/tmp
rm -f debian/tmp/build_all.adb
file_to_spec=sed -e "s/\.ads//" -e "s/-/./g" -e "s!.*/!!g"
debian/tmp/build_all.adb: debian/tmp
: # Construct a master program that withs everything
for file in src/*.ads; do \
grep -q -E "^private +((package)|(function)|(procedure))" $$file; \
if [ $$? -eq 1 ]; then \
spec=`echo $$file | $(file_to_spec)`; \
echo "with $$spec;" >> debian/tmp/build_all.adb; \
fi; \
done;
echo "procedure Build_All is" >> debian/tmp/build_all.adb
echo "begin" >> debian/tmp/build_all.adb
echo " null;" >> debian/tmp/build_all.adb
echo "end Build_All;" >> debian/tmp/build_all.adb
static-lib: debian/tmp/libLIBRARY.a
debian/tmp/libLIBRARY.a: debian/tmp/build_all.adb
: # Build the static library
gnatmake -c -j2 -g -Pbuild_all.gpr build_all
rm -f debian/tmp/build_all.{ali,o}
ar rc debian/tmp/libLIBRARY.a debian/tmp/*.o
ranlib debian/tmp/libLIBRARY.a
shared-lib: debian/tmp/libLIBRARY.so.$(major).$(minor)
debian/tmp/libLIBRARY.so.$(major).$(minor): debian/tmp/build_all.adb
: # Build the shared library
rm -f debian/tmp/*.{ali,o}
gnatmake -c -j2 -fPIC -Pbuild_all.gpr build_all
gnatgcc -shared -o debian/tmp/libLIBRARY.so.$(major).$(minor) \
debian/tmp/*.o \
-L$(adalib) \
-lgnat -lgnarl \
-Wl,--soname,libLIBRARY.so.$(major) -Wl,--export-dynamic
rm -f debian/tmp/build_all* debian/tmp/*.o
The above constructs a temporary file named build_all.adb,
which contains an empty procedure and withs all the non-private
packages in the library. This scheme effectively replaces upstream's
Makefile altogether, modulo any configuration or preprocessing
steps that may be necessary. I would personally advise upstream
library authors to consider using such a scheme in their
Makefiles.
The file build_all.gpr is quite simple:
project Build_All is
for Source_Dirs use ("debian/tmp", "src");
for Object_Dir use "debian/tmp";
for Main use "build_all.adb";
end Build_All;
(add package Compiler, Binder and/or Linker to taste)
(This section is normative.)
Rule: Each Ada library MUST follow the Debian Policy, i.e. it must consist of at least two, preferably three packages:
where N is the major number of the library.
(This section is normative.)
Rule: The -dev package SHALL provide all of the Ada source
files for the library, not just the specs (*.ads) and generic
bodies.
Rationale: This allows users to peruse the full source code in case of need.
Rule: All the *.ads and *.adb files SHALL reside in /usr/share/ada/adainclude/LIBRARY.
Rule: If the upstream sources require preprocessing the Ada source files before compilation, then the Ada files in /usr/share/ada/adainclude/LIBRARY SHALL be the preprocessed files corresponding to the shared library in /usr/lib.
Recommendation: There should not be any subdirectories under /usr/share/ada/adainclude/LIBRARY. If the upstream authors split the sources into several subdirectories, merge all source files into one directory, or else, provide several separate library packages. If you insist on providing subdirectories , make sure your project file (described below) reflects this.
Rationale: Splitting the sources in several directories makes navigation in the library source code more difficult in some editors or debuggers.
Rule: The directory with all Ada source files SHALL not contain any Makefiles, C language files or any other files that might be necessary to recompile the library.
Rationale: The intention is not that the user can recompile the library from /usr/share/ada/adainclude/LIBRARY; only that they can use it in their Ada programs. They can always recompile the library from the source package.
Rule: The -dev package SHALL NOT provide any *.o files.
Rule: The -dev package SHALL provide a static library in
/usr/lib/libLIBRARY.a.
Rule: The -dev package SHALL provide Ada Library Information
(*.ali) files that gnatgcc creates when compiling the
shared (not static) library.
Rule: The *.ali files SHALL have read-only permissions for all
users (i.e. r--r--r--, or 0444).
Rule: The *.ali files SHALL reside in /usr/lib/ada/adalib/LIBRARY.
Additional information: In Etch, lintian, Linda and
dh_fixperms are aware of these rules and enforce them.
Rule: The -dev package SHALL provide a symbolic link to the
shared library, as follows:
/usr/lib/libLIBRARY.so -> libLIBRARY.so.N.MINOR.PATCH
where MINOR and PATCH are the minor version number and patch level of the library. For example:
/usr/lib/libtexttools.so -> libtexttools.so.2.0.3
(This section is normative.)
Rule: The -dev package for each library SHALL provide a GNAT
project file named /usr/share/ada/adainclude/LIBRARY.gpr.
Rule: This file SHALL contain the path information and linker switches suitable for use with the library.
Example:
project LIBRARY is
for Source_Dirs use ("/usr/share/ada/adainclude/LIBRARY");
for Object_Dir use "/usr/lib/ada/adalib/LIBRARY";
Linker_Switches := "-lLIBRARY";
package Linker is
for Default_Switches ("Ada") use (Linker_Switches);
end Linker;
end LIBRARY;
Rule: The linker switches SHALL be declared as a variable.
Rationale: This makes it possible to use them, along with other linker switches, in a user's project file (see below for details).
Remark: Since the -dev and library packages provide precompiled
libraries, it is not necessary to provide `package Compiler' or
`package Builder' in the project file.
Rule: The shared library package (libLIBRARYN) SHALL provide these two files:
/usr/lib/libLIBRARY.so.N.MINOR.PATCH
/usr/lib/libLIBRARY.so.N -> libLIBRARY.so.N.MINOR.PATCH
where MINOR and PATCH are the minor version number and patch level of the library. For example:
/usr/lib/libtexttools.so.2.0.3
/usr/lib/libtexttools.so.2 -> libtexttools.so.2.0.3
The soname of the shared library must be libLIBRARY.so.N:
$ objdump -p /usr/lib/libtexttools.so.2.0.3 | grep SONAME
SONAME libtexttools.so.2
(This section is normative.)
Rule: Documentation SHALL be included either in the -doc
package or in the -dev package.
Rationale: If the amount of documentation is small, or if the
documentation consists mostly of comments in the Ada source files, it
is preferable to place it in the -dev package.
Remark: You may consider using adabrowse to generate HTML
documentation from the source files.
Rule: If the library provides Info files, then the Info files SHALL appear under “GNU Ada tools” in the top-level Info directory.
Additional information: This usually requires adding a few lines near
the top of the first Info file, before the first node. Here is an
example from package libaws-doc:
INFO-DIR-SECTION GNU Ada tools
START-INFO-DIR-ENTRY
* AWS: (aws). The Ada Web Server.
END-INFO-DIR-ENTRY
If you generate *.info files from *.texi files using makeinfo, the following lines achieve the desired effect:
@dircategory GNU Ada tools
@direntry
* AWS: (aws). The Ada Web Server.
@end direntry
Based on this information, dh_installinfo takes care of updating the top-level Info directory.
Rule: The -dev package SHALL have a README.Debian that explains
how to use the library in new programs.
Additional information: see Using shared libraries for details.
Rule: If the library provides example source files, they SHALL reside
under /usr/share/doc/LIBRARY-doc/examples or, if there is no
-doc package, in /usr/share/doc/LIBRARY-dev/examples.
Rule: Neither the source files, nor any Makefile present in the examples, SHALL be compressed.
Additional information: Be careful if you use dh_installexamples, as
it compresses any files larger than 4 kiB by default — use
-X.ads -X.adb -XMakefile as appropriate.
(This chapter is informative)
As a consequence of the Debian policy for Ada libraries, users of the
-dev packages have three consistent ways of using libraries in
their programs:
ADA_INCLUDE_PATH += :/usr/share/ada/adainclude/LIBRARY
ADA_OBJECTS_PATH += :/usr/lib/ada/adalib/LIBRARY
or
gnatmake -aI/usr/share/ada/adainclude/LIBRARY \
-aO/usr/lib/ada/adalib/LIBRARY \
PROGRAM \
-largs -lLIBRARY
or
write their own project file, and:
with "/usr/share/ada/adainclude/LIBRARY.gpr";
project PROGRAM is
for Source_Dirs use (".");
for Object_Dir use "obj";
for Exec_Dir use ".";
for Main use ("PROGRAM");
package Linker renames LIBRARY.Linker;
-- or:
-- package Linker is
-- for Default_Switches ("Ada") use (LIBRARY.Linker_Switches);
-- end Linker;
end;
The user may omit the full path to LIBRARY.gpr if the following environment variable is defined:
ADA_PROJECT_PATH = /usr/lib/ada/adalib
Also, the `.gpr' filename extension is optional in the `with' clause.
Note that these three ways are defined by GNAT. Some upstream library authors provide scripts (e.g. /usr/bin/gtkada-config for GtkAda), but their use should be discouraged because they do not work well when several libraries are used simultaneously. The recommended way to use libraries is the project files, especially when using several libraries at the same time:
with "/usr/share/ada/adainclude/LIBRARY_ONE.gpr";
with "/usr/share/ada/adainclude/LIBRARY_TWO.gpr";
project PROGRAM is
for Source_Dirs use (".");
for Object_Dir use "obj";
for Exec_Dir use ".";
for Main use ("PROGRAM");
package Linker is
for Default_Switches ("Ada") use
(LIBRARY_ONE.Linker_Switches, LIBRARY_TWO.Linker_Switches);
end Linker;
end;
The user may also wish to use the static library. Doing this is straightforward:
with "/usr/share/ada/adainclude/LIBRARY.gpr";
project PROGRAM is
package Linker is
for Default_Switches ("Ada") use ("/usr/lib/libLIBRARY.a");
end Linker;
end;
The user may also wish to recompile parts of the library into their program, possibly with different compile-time options. This is also possible with GNAT project files, but without with-ing the library-supplied project file:
project PROGRAM is
for Source_Dirs use (".", "/usr/share/ada/adainclude/LIBRARY");
for Object_Dir use "obj";
for Main use ("PROGRAM");
package Compiler is
for Default_Switches ("Ada") use
("-gnatafoy", "-O3", "-fno-unroll-loops", "-gnatVa", "-gnatwa");
end Compiler;
end PROGRAM;
The above examples can be mixed to suit the user's requirements. For example, one library can be linked statically, another can be compiled-in, and a third can be linked dynamically.
(This chapter is informative)
Help is wanted to further Ada, Debian and Ada in Debian. There are several areas where you can help: as an upstream author, or as a packager.
As an upstream author, you can contribute to the GCC, ASIS, GLADE and Florist projects to help bring a new stable compiler to Debian. You can also write new Ada libraries or enhance existing ones.
As a packager, you can select existing libraries or software programs, and package them for Debian. You should follow the Debian policy for Ada if you do this. It is not a healthy situation where the entire Debian community looks to a single person for all packaging; it is highly desirable to have at least a backup. The position is open for the taking.
If you are looking for a project to which you can contribute, or for something to package for Debian, here are a few web sites where you can look:
Please do not hesitate to coordinate with me.
(This appendix is informative)
Since I started maitaining GNAT, I have received over a hundred bug reports against the compiler. In most of these bugs, GNAT is too lax; it does not complain when presented with an illegal program. There are some quite subtle cases involved; processing these bugs has been a very good learning experience for me. You may be interested in perusing these bugs for your own benefit.
My processing of these bug reports has been, I believe, quite thorough. For each bug:
As it turns out, GCC 3.4 has approximately 80% of the bugs of GNAT 3.15p. It fixes some bugs, but also adds a few new ones.
When possible, I try to track the changes that fix bugs in GCC, and backport them to GNAT 3.15p. Thus, GNAT 3.15p is under active maintenance in Debian. If you would like to contribute, feel free to send me patches, I will accept them gratefully.
AdaCore also fix bugs that I report in each major release of GCC.
The test suite is available in the GNAT source package; to get the
test suite, just apt-get source gnat and look in the
testsuite directory.
You can search the Debian bug tracking system on the web here: http://bugs.debian.org
You can search the GCC bug database here: http://gcc.gnu.org.
(This appendix is informative)
I've done some extensive research on several GNU/Linux distributions, and even FreeBSD, to see how they handled libgnat's soname. Most distros never included the AdaCore public version of GNAT, and started shipping Ada only after GCC 3.2 went out.
| Variant | Version | Distribution | Shared libraries | soname
|
| AdaCore | 3.07 | binary tgz | /usr/lib/libgnat.so.3.07 | libgnat.so
|
| AdaCore | 3.09 | binary tgz | /usr/lib/libgnat.so.3.09 | libgnat.so
|
| AdaCore | 3.12p | Red Hat 7.0 | /usr/lib/libgnat-3.12p.so.1.12 | libgnat-3.12p.so.1
|
| AdaCore | 3.13p | Ada for Linux | /usr/lib/libgnat-3.13p.so.1.8 | libgnat-3.13p.so.1
|
| AdaCore | 3.13p | Red Hat 7.1 | /usr/lib/libgnat-3.13p.so.1.13 | libgnat-3.13p.so.1
|
| AdaCore | 3.13p | SuSE 8.0 | /usr/lib/libgnat-3.13p.so.1.7 | libgnat-3.13p.so.1
|
| AdaCore | 3.14p | Debian Woody | /usr/lib/libgnat-3.14p.so.1.1 | libgnat-3.14p.so.1
|
| AdaCore | 3.14p | FreeBSD 4.7 | /usr/local/lib/libgnat-3.14.so.1 | libgnat-3.14.so.1
|
| AdaCore | 3.15p | binary tgz | <prefix>/lib/gcc-lib/.../libgnat-3.15.so | libgnat-3.15.so
|
| AdaCore | 3.15p | from source | <prefix>/lib/gcc-lib/.../libgnat-3.15.so | libgnat-3.15.so
|
| AdaCore | 3.15p | Debian Sarge | /usr/lib/libgnat-3.15p.so.1.8 | libgnat-3.15p.so.1
|
| AdaCore | 3.15p | FreeBSD 4.8 | /usr/local/lib/libgnat-3.15.so.1 | libgnat-3.15.so.1
|
| FSF | 3.2 | Mandrake 9.0 | /usr/lib/libgnat-3.15a.so.1 | libgnat-3.15a.so.1
|
| FSF | 3.2 | Red Hat 8 | /usr/lib/libgnat-3.15a.so.1 | libgnat-3.15a.so.1
|
| FSF | 3.2 | SuSE 8.1 | /usr/lib/libgnat-3.15a.so | libgnat-3.15a.so
|
| FSF | 3.2.2 | ASPLinux | /usr/lib/libgnat-3.15a.so.1 | libgnat-3.15a.so.1
|
| FSF | 3.2.2 | Mandrake 9.1 | /usr/lib/libgnat-3.15a.so.1 | libgnat-3.15a.so.1
|
| FSF | 3.2.2 | Red Hat 9 | /usr/lib/libgnat-3.15a.so.1 | libgnat-3.15a.so.1
|
| FSF | 3.2.2 | Slackware 9.0 | none | none
|
| FSF | 3.2.2 | Yellow Dog | /usr/lib/libgnat-.so.1 | libgnat-.so.1
|
| FSF | 3.2.3 | Slackware 9.1 | none | none
|
| FSF | 3.3 | Polish Linux | /usr/lib/libgnat-3.15.so.1 | libgnat-3.15.so.1
|
| FSF | 3.3 | SuSE 8.2 | /usr/lib/libgnat-3.15.so | libgnat-3.15.so
|
| FSF | 3.3 | from source | <prefix>/lib/gcc-lib/.../libgnat-3.15.so | libgnat-3.15.so
|
| FSF | 3.3.1 | Mandrake 9.2 | /usr/lib/libgnat-3.15.so.1 | libgnat-3.15.so.1
|
| FSF | 3.3.1 | SuSE 9.0 | /usr/lib/libgnat-3.15.so | libgnat-3.15.so
|
| FSF | 3.3.2 | Fedora Core 1 | /usr/lib/libgnat-3.15.so.1 | libgnat-3.15.so.1
|
| FSF | 3.3.2 | Mandrake 10.0 | /usr/lib/libgnat-3.15.so.1 | libgnat-3.15.so.1
|
| FSF | 3.3.3 | Fedora Core 2 | /usr/lib/libgnat-3.15.so.1 | libgnat-3.15.so.1
|
| FSF | 3.3.3 | SuSE 9.1 | /usr/lib/libgnat-3.15.so | libgnat-3.15.so
|
| FSF | 3.3.4 | SuSE 9.2 | /usr/lib/libgnat-3.15.so | libgnat-3.15.so
|
| FSF | 3.3.5 | SuSE 9.3 | /usr/lib/libgnat-3.15.so | libgnat-3.15.so
|
| FSF | 3.3.6 | Debian Sarge | none | none
|
| FSF | 3.4 | source CVS | <prefix>/lib/gcc-lib/.../libgnat-3.4.so | libgnat-3.4.so
|
| FSF | 3.4.1 | Mandrake 10.1 | /usr/lib/libgnat-3.4.so.1 | libgnat-3.4.so.1
|
| FSF | 3.4.2 | Fedora Core 3 | /usr/lib/libgnat-3.4.so.1 | libgnat-3.4.so.1
|
| FSF | 3.4.4 | Debian Sarge | /usr/lib/libgnat-3.4.so.1 | libgnat-3.4.so.1
|
| FSF | 4.0.0 | from source | <prefix>/lib/gcc/.../libgnat-4.0.so | libgnat-4.0.so
|
| FSF | 4.0.0 | Fedora Core 4 | /usr/lib/libgnat-4.0.so.1 | libgnat-4.0.so.1
|
| FSF | 4.1.0 | from source | <prefix>/lib/gcc/.../libgnat-4.1.so | libgnat-4.1.so
|
| FSF | 4.1.0 | Debian Etch | /usr/lib/libgnat-4.1.so.1 | libgnat-4.1.so.1
|
The ellipsis (...) stands for <target>/<version>/adalib, for example
i486-linux-gnu/4.1.0/adalib.
All GNU/Linux distributions have historically ignored the AdaCore default soname and used one consistent pattern, libgnat-x.xxp.so.1. This includes Debian Woody. For Sarge and Etch, I have chosen to continue this tradition. This allows, by the way, installing both Debian's and AdaCore's binary distributions on the same system.
(This appendix is informative)
The compiler and all Ada packages will transition from gnat 3.15p in Sarge to gnat-4.1 in Etch.
In 2004, even before Sarge was released I had laid out a plan for Etch, and published it in the First Edition of this Policy. The plan was to choose a new Ada compiler for Etch, and transition all packages to it. The new Ada compiler would be either the next “p” release from AdaCore, which was the preferred solution, or the latest release of GCC available roughly 3 months before the freeze of Etch. These 3 months would be used to actually perform the transition.
When AdaCore released GNAT GPL 2005 Edition, my nice plans for Etch fell apart, because the license change for libgnat meant that some users would be unhappy about this compiler. While I have no objection to this license change, I felt that my duty as a distribution maintainer was to ask what users wanted, and so I did. I asked for all interested people to vote on one of GNAT GPL 2005 Edition, gnat-3.4, gnat-4.0 or gnat-3.4 with patches backported from GNAT GPL, 4.0 and 4.1. Each voter could give one negative vote to express utter rejection, two positive votes for a strong preference, or one vote for a normal preference. Here are the results of the vote:
| Variant | Votes
|
| GNAT GPL 2005 Edition | -11
|
| gnat-3.4 | 7
|
| gnat-4.0 | 16
|
| gnat-3.4+patches | 0
|
Here is a summary of the arguments that were expressed by various people on comp.lang.ada while debating on the Ada compiler for Etch. The arguments are in no particular order, and the summaries are mine.
The anarchist argument: it is immoral for AdaCore to dictate how libgnat should be used; everyone should be free to use libgnat however they see fit, and the GPL uses violent but lawful means to make this impossible. Therefore, everyone should reject the GNAT GPL 2005 Edition.
The Free Software argument: it is immoral to write non-free software; it is even more immoral to use a free software library such as libgnat in non-free software. It is appropriate to make this illegal by releasing libgnat under the GPL. Therefore, everyone should embrace GNAT GPL 2005 Edition.
The Other Free Software argument: we make Free Software under a license which is incompatible in some ways with the GPL (e.g. the BSD license). The GPL prohibits linking libgnat with our software and distributing our binaries. Therefore, we reject the GNAT GPL 2005 Edition.
The selfish argument: we make commercial proprietary software with GNAT, but we cannot or will not pay for GNAT Pro. If libgnat is under GPL, we can no longer distribute our proprietary software. Therefore, we reject GNAT GPL 2005 Edition.
The interoperability argument: our software has to link with non-free software which is outside our control, and the license of which prohibits use of GPLed libraries (variant: we link with other Free libraries which are under licenses not compatible with the GPL); therefore we are forced to reject GNAT GPL 2005 Edition.
The betrayed author's argument: I made contributions to the software that is now supported commercially by AdaCore, with the understanding that the license was the GMGPL. AdaCore revoked the special permission without consulting me. While this is specifically allowed by the GPL, I feel betrayed. Therefore, I reject the GNAT GPL 2005 Edition.
The technical quality argument: GNAT GPL 2005 Edition is the best available Ada compiler. GCC 3.4 is not as up-to-date with respect to Ada 2006, and GCC 4.0 is less stable. Therefore, we should embrace GNAT GPL 2005 Edition.
The marketing argument: licensing libgnat under the GPL hinders promotion of Ada, especially to small businesses (per the selfish argument). The move tries to promote Free Software at the expense of Ada. Free Software does not need much promotion while Ada does. Therefore, we should reject GNAT GPL 2005 Edition.
June 2005 - Sarge released. gcc-4.0 enters testing. Several major transitions start simultaneously: g++ from 3.3 to 4.0 (with ABI change), XFree86 4.3 to X.org 6.8, GNOME from 2.8 to 2.10. Other transitions are planned, as well.
September 2005 - Java, Treelang, libffi and several other binary packages are no longer built from gcc-3.3 or gcc-3.4, but only from the gcc-4.0 source package.
November 2005 - Release branch for GCC 4.1 created. gcc-4.1 reaches experimental.
December 2005 - gnat-3.3 removed from Etch.
February 2006 - GCC 4.1.0 released.
March 2006 - gnat-3.4 removed from Etch. Ground work starts on gnat-4.1 in experimental:
? - gcc-4.1 reaches unstable.
? - gcc-4.1 becomes the new default compiler for C, C++, Fortran 95, Java, Objective-C and Objective-C++.
? - gnat (=4.1) uploaded, depends on gnat-4.1 (>=4.1.0). This marks the official transition to GCC 4.1 as the new default compiler for Ada. All Ada libraries must change their sonames, and all packages require recompilation.
? - ghdl transitions to gnat-4.1.
? - gcc-4.0 removed from Debian. gcc-3.4 remains for Fortran 77 and Pascal only.
September 2006 - toolchain freeze
October 2006 - general freeze
December 2006 - Etch released 18 months after Sarge.