Building cross gnat + minimal RTS
BELBACHIR Selim
selim.belbachir@fr.thalesgroup.com
Tue Nov 15 12:26:00 GMT 2011
Hi,
I'm trying to build a gnat cross compiler based on gcc 4.5.2 for my private target (named prism). To do this, I'm using a native gnat-6.4.2 (containing gcc 4.5.2).
I want the minimal amount of lib and runtime so I presume that I nearly only need to provide 'system.ads'. (I will add secondary stack management later).
I don't find the standard procedure to build my cross gnat + minimal RTS.
First I configure this way :
configure --prefix=$(INSTALLDIR) --target=prism --disable-nls --enable-languages=c,ada --with-gmp=$(INSTALLDIR) --with-mpfr=$(INSTALLDIR) --with-mpc=$(INSTALLDIR) LDFLAGS="-static" --without-libiconv-prefix --disable-libmudflap --disable-libffi --disable-libstdcxx-pch --disable-libada --disable-libgcc --disable-libssp --enable-checking=release
Then I simply do :
make
make install
but it ends like this :
You must first build the GNAT library: make gnatlib
make[5]: *** [../stamp-gnatlib-rts] Error 1
make[4]: *** [install-gnatlib] Error 2
(I though that --disable-libada option would disable the need for libs...)
At this point my new cross compiler provide the following error when I try to compile a simple adb :
fatal error, run-time library not installed correctly
cannot locate file system.ads
compilation abandoned
If I copy manually my system.ads into the right install dir (taking example on another working cross compiler), my cross compile seems to work.
I browsed the source directory gcc/ada, and I tried to insert the following lines in gcc/ada/gcc-interface/Makefile.in hoping it will copy my system-prism.ads automatically during build process :
ifeq ($(strip $(filter-out %prism,$(arch))),)
LIBGNAT_TARGET_PAIRS = \
system.ads<system-prism.ads
endif
I also saw the Makefile.hie in gcc/ada, but I don't understand how it interact with other makefiles...
The global question is : Which files has to be altered in order to build a minimal gnat compiler for a new target (the target backend works with C) ?
More information about the Gcc
mailing list