Skip to content

FindingAnRTS

Simon Wright edited this page Aug 7, 2017 · 4 revisions

The GNAT compiler running under gprbuild can find RTSs in various ways. An RTS usually contains an adainclude/ directory with the source of the RTS and an adalib/ directory with the corresponding library, linker script and .ali files (these defaults can be changed by listing the source directory, or colon-separated directories, in ada_source_path, and the object directory in ada_object_path).

If not the default, the RTS can be named on the command using a --RTS= option. In a GPR, you can do this in package Builder (so it's applied during all phases of the build):

package Builder is
   for Default_Switches ("ada") use
     (
      "-g",
      "-O0",
      "--RTS=stm32f429i"
     );
end Builder;

or, with GPRBUILD GPL 2015 or later, via an attribute:

for Runtime ("ada") use "stm32f429i";

There are two places where RTSs can be installed:

  • in the location indicated by arm-eabi-gcc -print-libgcc-file-name; for GNAT GPL 2015, that would be $prefix/lib/gcc/arm-eabi/4.9.4/, referred to from here as $lib.
  • in $prefix/arm-eabi/lib/gnat.

You can also work with an RTS in its build location.

In $lib:

The directory containing the RTS should be called rts-{name}, for example rts-stm32f429i.

If the RTS is named stm32f429i, the compiler will treat it as the default RTS (and you need a default RTS) if

  • $lib contains text files ada_object_path, ada_source_path containing the locations of the adalib and adainclude directories of the RTS respectively, and (GCC 5.0) there is a file adainclude/system.ads; or
  • $lib contains symbolic links named adalib and adainclude to the adalib and adainclude directories of the RTS respectively.

Alternative RTSs are found here if they are in directories named rts-{name}, for example rts-stm32f429i/ corresponds to --RTS=stm32f429i.

In $prefix/arm-eabi/lib/gnat:

The directory containing the RTS is just called {name}, e.g. stm32f429i.

In the build location:

RTSs can also be located by giving the explicit path in the Runtime ("ada") attribute or the --RTS= option (this has to be an absolute path with GPRBUILD GPL 2015):

package Builder is
   for Default_Switches ("ada") use
     (
      "-g",
      "-O0",
      "--RTS=“ & Project’Project_Dir & "../stm32f429i"
     );
end Builder;

or

for Runtime ("ada") use Project’Project_Dir & "../stm32f429i";
Clone this wiki locally