From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,1d2fc55e2c7a55b6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z19g2000yqk.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: GNAT 2009, Windows and system libraries Date: Wed, 10 Feb 2010 07:45:52 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <690a26b0-70fd-4d0c-8169-fe803594938d@z17g2000yqh.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1265816753 11726 127.0.0.1 (10 Feb 2010 15:45:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 10 Feb 2010 15:45:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z19g2000yqk.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9089 Date: 2010-02-10T07:45:52-08:00 List-Id: Maciej Sobczak wrote on comp.lang.ada: > On 10 Lut, 16:21, Maciej Sobczak 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.