Building gnatlib

Is there any way to do a stand alone build of
lingnarl and libgnat without building the whole of gcc?

I’ve tried the following,

mkdir build && cd build
../gcc/configure --enable-languages=ada
cd ada
make gnatlib

but it fails with

raised raised ADA.IO_EXCEPTIONS.NAME_ERROR : s-oscons-tmplt.s: No such file or directory

(having previously issued rm -f rts/s-oscons-tmplt.i rts/s-oscons-tmplt.s

(post deleted by author)

That looks like a missing file or directory to me.

Looks like the immediate cause of the first fail, is that the generated Makefile uses a variable,

$GCC_FOR_TARGET which is undefined when used. Hence errors such as;

/bin/bash: line 2: -W: command not found
/bin/bash: line 3: -W: command not found

because the command should have been gcc -W etc, not just -W.

Defining GCC_FOR_TARGET, the build gets a bit farther,

then fails because tconfig.h is missing. I understand that file should be created

by configure, but is not.

adaint.c:129:10: fatal error: tconfig.h: No such file or directory

run gnatls -v
under “source path” is where your systems rts is. For me it’s /usr/lib/gcc/x86_64-pc-linux-gnu/15/adainclude. If you don’t have gnat but gcc with Ada support you can also run gcc -print-file-name=adainclude to get the path.

You can now build it yourself using by compiling it using -gnatg but I’m not sure if that will work on your system.

If you have the gcc source code you can just use libada.gpr. I haven’t tried that tho. See:

https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/ada/libgnat/libada.gpr;h=2848c566ee10cdf5844786fd433d75175510726d;hb=refs/heads/master

Success, Thanks!! :grinning_face:

I’m building using gcc source. After the configure step I described above,

this is what I did.



cd ada/rts

mkdir rts-debug

cp rts-debug

cp -a gprls -v | grep adainclude .

cp -a -v ../../*.c .

cp -a -v ../../*.h .


(Copied in unwind-pe.h from libgcc)

gprbuild -p -Plibada -j0 -XCFLAGS="-O2 -g" -XADAFLAGS="-gnatn"

I think the key bit I was missing, was all the gprbuild switches.