comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Strange error in mixed language program (incompatible libraries?)
Date: 14 Aug 2004 16:29:02 +0100
Date: 2004-08-14T16:29:02+01:00	[thread overview]
Message-ID: <x7visblrb5t.fsf@smaug.pushface.org> (raw)
In-Reply-To: c8qhh0hlvbk7us62bsbs1u2643rfc80m3m@4ax.com

James Alan Farrell <anonymous@anonymous.com> 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.adb \
     | egrep -v "BEGIN|END" \
     | sed -e "s/--//" > 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.



  parent reply	other threads:[~2004-08-14 15:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-09 18:37 Strange error in mixed language program (incompatible libraries?) James Alan Farrell
2004-08-10  6:40 ` Simon Wright
2004-08-10  7:04 ` Jerry van Dijk
2004-08-10 13:01   ` Marc A. Criley
2004-08-10 15:31 ` James Alan Farrell
2004-08-10 21:36   ` James Alan Farrell
2004-08-14 15:29   ` Simon Wright [this message]
2004-08-11  8:58 ` Pascal Obry
replies disabled

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