Tristan Gingold wrote:
> On 26/01/15 09:19, Andreas Hindborg wrote:
>> Hi,
>>
>> Tristan Gingold wrote:
>>>> In some of our use of GHDL, we link the GHDL runtime with another
>>> - hide quoted text -- show quoted text -
>>>> 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:
>>>
>>> How do you link your application ?  libgrt is provided as a static
>>> library, so its members are extracted only if needed.  Therefore, making
>>> main weak shouldn't be required.
>>
>> We use the following when linking:
>> $GHDL --bind $GHDL_OPTIONS $TARGET
>> $CC `$GHDL --list-link $GHDL_OPTIONS $TARGET` -o $TARGET $C_OBJECTS
> 
> Did you try to switch order of arguments:
> 
> $CC $C_OBJECTS `$GHDL --list-link $GHDL_OPTIONS $TARGET` -o $TARGET

That seems to work! Thanks =)

-- 
Best regards,
Andreas Hindborg
PhD Student
DTU Compute


_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to