Trying to build Tango as dynamic library on linux

Jacob Carlborg doob at me.com
Sun Jun 27 10:25:35 PDT 2010


On 2010-06-27 12:35, jpf wrote:
> Hi,
> are you still working on that? I tried to use druntime as a dynamic library on
> Linux, and I had exactly the same problem. (version node not found for symbol
> _d_throw at 4)
> Googling showed that this problem has been discussed before:
> http://digitalmars.com/d/archives/digitalmars/D/libphobos_as_.so_54793.html
>
> So because of the extern(Windows) / _stdcall calling convention, dmd emits the @4
> ( http://en.wikipedia.org/wiki/Name_mangling#C_name_decoration_in_Microsoft_Windows
> )
> If I understand this
> http://people.redhat.com/drepper/symbol-versioning
> correctly, ELF uses symbol names like _d_throw at 4 as name at version. As there is no
> entry for version 4, linking fails. I guess mac is not affected, because Mach-O
> accepts _d_throw at 4 as a symbol name.
>
> It seems like nothing has changed since then.
> http://www.dsource.org/projects/druntime/browser/trunk/src/rt/deh2.d
> http://www.dsource.org/projects/druntime/browser/trunk/src/rt/deh.c
>
> _d_throw is still extern(Windows) / _stdcall and i guess dmd would still emit calls
> to _d_throw at 4 if _d_throw was changed to extern(C).
>
> Btw: Someone seems to have found a basic workaround for the name mangling problem:
> http://www.curoles.com/j/dso/dso.html
>
> But i guess, this should really be fixed in the compiler and druntime.

I'll have a look at these links later and see if I can do something 
about it, thanks.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list