Greetings, In some of our use of GHDL, we link the GHDL runtime with another executable in order to use the foreign language feature of GHDL. We start the GHDL simulation in accordance with the GHDL manual by calling ghdl_main(). This works fine on OS X, but on Linux the application fails to link with a duplicate symbol error for main(). The problem seems to be that the main symbol is present in libgrt. The problem can be fixed by marking the main function in libgrt as weak:
--- a/translate/grt/main.ads Sun Dec 21 21:29:39 2014 +0100 +++ b/translate/grt/main.ads Tue Jan 13 10:39:28 2015 +0100 @@ -32,3 +32,4 @@ function Main (Argc : Integer; Argv : System.Address) return Integer; pragma Export (C, Main, "main"); +pragma Weak_External (Main); EOF -- Best regards, Andreas Hindborg PhD Student DTU Compute _______________________________________________ Ghdl-discuss mailing list [email protected] https://mail.gna.org/listinfo/ghdl-discuss
