comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: GNAT 2009, Windows and system libraries
Date: Wed, 10 Feb 2010 07:45:52 -0800 (PST)
Date: 2010-02-10T07:45:52-08:00	[thread overview]
Message-ID: <c2e8d6c1-045a-4efe-96c4-99e975100bbe@z19g2000yqk.googlegroups.com> (raw)
In-Reply-To: a4dcdfe1-fa41-4619-9a81-2d596195d986@h2g2000yqj.googlegroups.com

Maciej Sobczak wrote on comp.lang.ada:
> On 10 Lut, 16:21, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
>
> > After struggling a while, I was able to compile everything by hand -
> > that is, by manually running the GNAT toolchain.
> > The problem with the use of .gpr files is that in the final incovation
> > of gnatlink, libraries are listed in the order that comes from the
> > depth-first traversal of all .gpr files that are connected by "with"
> > relationships, which leads to unresolved references. The order that I
> > need is depth-first (or more generally, topologically sorted).
>
> What a mess above. :-)
>
> Final update: I was able to get the clean compile with proper order of
> "with" clauses in .gpr files. The only curiosity is that libraries are
> passed to linker in the order that is *reverse* to the order of
> relevant "with" statements.
>
> I'm not sure if that was intended, but as long as I can control the
> results, it is just a minor detail.

The problem seems a little deeper than that.

with "a";
with "b";
project P is
   ...
end P;

translates to:

ld -o p p.o -lb -la

which is appropriate if libb.so needs to see the symbols in liba.so.
However, in that case, b.gpr ought to have a with "a"; clause.  If
b.gpr lacks the clause, nothing allows the project manager to assume
that libb.so needs liba.so. I suspect that the project manager was
trying to be too clever for its own good; it was potentially hiding a
problem (missing "with a" in b.gpr) while breaking the Law of Least
Astonishment.

I'm not sure whether this is a genuine bug or not. Mmmh. Meditate on
this, I will.

--
Ludovic Brenta.



      reply	other threads:[~2010-02-10 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10 11:13 GNAT 2009, Windows and system libraries Maciej Sobczak
2010-02-10 11:40 ` Hibou57 (Yannick Duchêne)
2010-02-10 15:21 ` Maciej Sobczak
2010-02-10 15:35   ` Maciej Sobczak
2010-02-10 15:45     ` Ludovic Brenta [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox