[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gcc-gnat sources



"Pavel Zhukov" <pavel@zhukoff.net> writes:
> Hi all
>
> My name is Pavel and I'm Fedora packager.
> Currently I'm working on Ada packages from GNAT-2011. But I have some
> troubles with gprbuild. Gprbuild-2011 contains SPARK support in /gnat
> subfolder. I have to point gcc-gnat sources before configure to avoid
> this (gprbuild README), but gcc-gnat doesn't bring any sources after
> installation. Does anybody solve this issue?
>
> Redhat bugzilla:
> https://bugzilla.redhat.com/show_bug.cgi?id=722732
> GCC bugzilla:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49783

I think the problem is deeper and more general than just SPARK support.

Gprbuild has nothing to do with SPARK; it is only a compiler driver
after all and, since it is supposed to support arbitrary source
languages through plug-ins, it cannot possibly want to parse every
language it supports.

OTOH, gprbuild must parse its own "project file" language, which it
shares with gnatmake, which is part of GNAT and resembles Ada.  So, the
sources of gprbuild GPL 2011 contain a partial copy of the sources of
GNAT, sufficient for parsing the .gpr files.  It is only a coincidence
that the parser for the .gpr language shares some sources with the
parser for Ada and SPARK.

Historically, the partial copies in gprbuild 1.2 and 1.3 were out of
sync with the corresponding sources in GNAT GPL 2009, GNAT GPL 2010, FSF
GCC 4.3 and FSF GCC 4.4.  In other words, gprbuild contains a "snapshot"
of these sources taken at a different time than any public release.

The ideal way to resolve this problem is to build gprbuild against
libgnatvsn (GNAT Version Library, GPL3 with Library Exception) and
libgnatprj (GNAT Project File parser, pure GPL), two libraries that I
created for this very purpose.  In Debian, I build these libraries from
the GCC sources; the -dev packages place the sources in
/usr/share/ada/adainclude/libgnat{vsn,prj} so that other programs can
use them.  Gnatmake and GPS are two such programs and gprbuild is a good
third candidate.

Unfortunately, Stephe has been unable to use these libraries when
packaging gprbuild 1.2 and 1.3 for Debian; the impedance mismatches were
too large.  He was able to build both versions using the partial copy of
GNAT supplied with gprbuild.

For Fedora, I would recommend the following:

* plan A: replicate libgnatvsn and libgnatprj and build gprbuild against
  them (linking dynamically as an added bonus).

* plan B: in the source package (.srpm) of gprbuild, copy the missing
  source files from GNAT GPL 2011.  Build against that.

Both plans may require patching gprbuild itself to resolve any impedance
mismatches between the core of gprbuild and the .gpr language parser.

-- 
Ludovic Brenta.


Reply to: