Project:Ada

Has Name::Ada Project
Description Has Description::This project provides support for Ada compilers and libraries in Portage. At present a gnat compiler is provided: gnat-gpl by AdaCore.
Project email Has Contact::ada@gentoo.org
IRC channel #ada
Lead(s) SMW::off
  • Alfredo Tupone (tupone)
  • Steve Arnold (nerdboy)
SMW::on
Last elected: Has Lead Election Date::2019/04/17
Member(s)
Subproject(s)
(and inherited member(s))
(none)
Parent Project Gentoo
Project listing

Aim of the project

The project maintains the compiler, builder, system library and IDE for ada.

The spark language, based on ada and aimed at safety and security, is also supported.

The reference sources are the one present in the libre.adacore.com site, maintained by AdaCore.

We also hope to integrate gnat-gcc with the standard toolchain packages starting with 6.x/7.x, with new arches added as new bootstraps become available (see the ada-overlay on github for the current packages/eclass).

Current packages

At present

packages are part of the project.

Compilers

Compilers are available for both x86 32 and 64 bits

  • dev-lang/gnat-gpl-2016 slotted 4.9.4
  • dev-lang/gnat-gpl-2017 slotted 6.3.0
  • dev-lang/gnat-gpl-2018 slotted 7.3.1.
  • dev-lang/gnat-gpl-2019 slotted 8.3.1.

Each dev-lang/gnat-gpl compiler conflict with the sys-devel/gcc on the same slot.

dev-lang/gnat-gpl share in fact most of the sources and the binaries with gcc.

To build the compiler unfortunately you need an ada/c/c++ compiler already available, to produce an ada/c/c++ compiler.

If you don't mess with the bootstrap use flag, the Ada compiler will be built using the gnat-gpl-2014-*-linux-bin.tar.gz from libre.adacore.com.

When you disable the bootstrap use flag, the build compiler will be using the information set in the file etc/portage/make.conf

FILE /etc/portage/make.confADA setting
<syntaxhighlight lang="bash">ADA=x86_64-pc-linux-gnu-gcc-4.9.4
ADAFLAGS=${CFLAGS}
FEATURES="nostrip"</syntaxhighlight>

This will indicate the

  • the ADA compiler used to build the Ada compiler (if available)
  • the ADA compiler FLAGS, used to build Ada packages
  • optionally the nostrip features (or splitdebug) to retains symbol in the gnat runtime (e.g. catch exception with debugger)

The ADA variable is the name of the gcc compiler that can compile ada files and that will be used to build the ada compiler. Is not used for anything else. If you do not specify the ADA variable, the system gcc compiler will be used instead, if capable.

Once installed you can use the compiler either

  • by selecting it with gcc-config. In this case you also change the default c/c++ compiler (and this is not supported to upgrade gentoo)
  • by postfixing any ada command with its own version: eg. gnatmake-4.9.4

Building the dev-ada packages

When building the ada related packages, you need to indicate which version of compilers to use by setting teh ADA_TARGET variable in the file etc/portage/make.conf

FILE /etc/portage/make.confADA setting
<syntaxhighlight lang="bash">ADA_TARGET="gnat_2016"</syntaxhighlight>

The value used are

  • gnat_2016 to select dev-lang/gnat-gpl-2016
  • gnat_2017 to select dev-lang/gnat-gpl-2017
  • gnat_2018 to select dev-lang/gnat-gpl-2018
  • gnat_2019 to select dev-lang/gnat-gpl-2019

Compiler changes

When you want to use a new ada compiler you need to change the make.conf to reflect this choice

FILE /etc/portage/make.confADA setting
<syntaxhighlight lang="bash">ADA_TARGET="gnat_2017"</syntaxhighlight>

i.e. enabling gnat_2017 and then rebuild all ada packages

This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.