Quoting Alex Huntley <[email protected]>: > 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
