Hi Tristan
Thanks for the reply. I've been reading through the gnat manual and haven't found anything that I've not been doing.
When you say "load", what do you mean exactly?
Is there an example of building stand-alone libraries that you could point me towards? I've scoured the web but haven't found anything that explains what I'm doing wrong. I appreciate that it's probably my inexperience that is the ultimate cause and I don't want to take up too much of your or anybody else's time, so if you know of a tutorial or example that would be great.
Many thanks
Alex
> Greetings
>
> I was hoping that somebody might help me with a problem that I've been
> having implementing foreign sub-programs in Ada. I've stripped it all
> right back to a simple function which just returns a long_float/real
> value (just a literal in the code at the moment):
>
> function test (input : long_float) return long_float is begin
> return 325169.5467;
> end test;
>
> Now, when GHDL calls this from the VHDL code it produces a list of
> undefined references (e.g. `__gnat_eh_personality'). If I recompile
> with "pragma No_Run_Time;" then these all disappear but GHDL returns
"exec errror".
>
> As a test I've re-written the function in C:
>
> double test_c (double input) {
> return 12476.246;
> }
>
> and this works fine, so I'm guessing it's something to do with the way
> I'm compiling the ada code, the gnat installation or possibly the way
> GHDL is looking for the ada run time library?
GHDL is not looking for the ada run time library.
So you have to take care of this.
You can't expect to execute an Ada subprogram without first elaboration.
You have to build a stand-alone library (See GNAT manual for the
details) and then load it.
Tristan.
_______________________________________________ Ghdl-discuss mailing list [email protected] https://mail.gna.org/listinfo/ghdl-discuss
