Builds of the GNAT Ada compiler from FSF GCC releases
This fork adds the aarch64-elf target with a rpi3 runtime.
To start the builds you will need python3
and the e3-core
package.
This can be done in a virtual env, e.g.:
$ python3 -m venv my-virtual-env
$ source my-virtual-env/bin/activate
$ pip install e3-core==22.1.0
If your Linux distribution is using Python 3.12 or greater, the distutils module is not available by default, so you'll want to install that:
$ pip install setuptools
It is suggested you build gprbuild / gprconfig via this repository also, on Ubuntu 24.04 the gprbuild
package is an
older version that will not properly recognize the toolchain.
$ ./anod build release_package --qualifier=package=gprbuild -v --loglevel DEBUG
This will generate the tarball at ./sbx/x86_64-linux/release_package-gprbuild-x86_64-linux/install/gprbuild-x86_64-linux-24.0.0-1.tar.gz
that includes gprbuild
and gprconfig
and other tools.
Now, to build the cross-compiler:
$ ./anod build release_package --qualifier=package=gnat --target=aarch64-elf -v --loglevel DEBUG
This will generate a tarball at ./sbx/aarch64-elf-linux64/release_package-gnat-aarch64-elf-linux64/install
that
includes the compiler, gdb, and the embedded-rpi3
, light-rpi3
and light-tasking-rpi3
RTSes, but does not include
gprbuild
or other components.
You'll want to extract this tarball from the previous section somewhere, something like $HOME/arm
, and then add it
to your PATH
, like the following:
$ mkdir $HOME/arm
$ cd $HOME/arm
$ tar xf $HOME/src/GNAT-FSF-builds/sbx/aarch64-elf-linux64/release_package-gnat-aarch64-elf-linux64/install/gnat-aarch64-elf-linux64-14.1.0-2.tar.gz
To start the builds you will need python3
and the e3-core
package.
This can be done in a virtual env, e.g.:
$ python3 -m venv my-virtual-env
$ source my-virtual-env/bin/activate
$ pip install e3-core==22.1.0
To build a spec, for example mpc
, run the anod
script:
$ ./anod build mpc -v --loglevel DEBUG
-v --loglevel DEBUG
will produce many information log about the build.
For a cross compiler:
$ ./anod build gcc --target=avr-elf -v --loglevel DEBUG
Only builds in the msys2 mingw64 environement are supported. You will need:
-
mingw-w64-x86_64-python-psutil
package fore3-core
installation to work. -
The Unix and Windows PATH of the repo checkout must match:
C:\dir1\dir2\GNAT-FSF-builds
<->\dir1\dir2\GNAT-FSF-builds
. This can be done by "mounting" Windows directories in msys2, e.g.:mount C:/Users /Users
.
Until the e3-core
/anod
documentation is available online, the best way to
write a spec is to start from an existing one. A good starting point would be
gnatcoll.anod
.
- First, change the
version
,tarball
and,source_pkg_build
url - Modify the list of
build_deps
, you probably need at leastgcc
. - Change the configure/make options
A little script is available to speedup the process of publising GNAT FSF package to the Alire index.
Edit the PKG_VERSION and CRATE_VERSION constant and then run the script to generate all the GNAT manifests. The script also checks the correctness of sha256 hashes.