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: 103376,d481d546f914128d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!proxad.net!proxad.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Strange error in mixed language program (incompatible libraries?) Date: 14 Aug 2004 16:29:02 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1092497672 1779 62.49.19.209 (14 Aug 2004 15:34:32 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 14 Aug 2004 15:34:32 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: g2news1.google.com comp.lang.ada:2732 Date: 2004-08-14T16:29:02+01:00 List-Id: James Alan Farrell writes: > I have found the following in the make file (set up by someone else > before I joined the project): > > b~ada_interface.o: ada_interface.o > gnatbind -n ada_interface.ali > gnatmake -c b~ada_interface.adb > > > Ada_interface has a number of children > (ie, ada_interface-this.ad[bs] and ada_interface-that.ad[bs]) > > Do their .ali files need to be explicitly listed in the above bind > command? No, provided that they are in the closure .. The last time I set this up I used Imake, so the rules are a tad obscure, and I had adabind output in C instead of Ada, but the gist was .. the b~ada_interface.adb file contains a set of comments which list all the linker commands (mainly .o files) needed. So I extracted these comments into a "response file" and catted the file as part of the linker commands. Looking at one of my scratch builds, in b~main.adb I have -- BEGIN Object file/option list -- ./tasks.o -- ./main.o -- -L./ -- -L/opt/3.16a1/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/adalib/ -- -L/opt/3.16a1/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/adalib/ -- -static -- -lgnarl -- -lgnat -- -lpthread -- END Object file/option list so I need to extract the lines between BEGIN and END and remove the leading --. Something like sed -n -e "/BEGIN/,/END/p" b~main.r (I'm sure there's a better way to do that!) All this is done automatically by gnatlink, but I don't think that works if the main program isn't in Ada. -- Simon Wright 100% Ada, no bugs.