Segmenation fault in rt_finalize2 when using std.stdio with shared libraries
Harm via digitalmars-d-ldc
digitalmars-d-ldc at puremagic.com
Sat Oct 18 12:24:21 PDT 2014
I'm trying to create a shared D library. I use the code from
http://dlang.org/dll-linux.html#dso10 (the last 2 files, main.d
and dll.d). I can successfully compile and run them with:
ldc2 -oflibdll.so dll.d -shared -defaultlib=phobos2-ldc
ldc2 main.d -L-ldl -defaultlib=phobos2-ldc,druntime-ldc -L-rpath=.
As soon as I add import std.stdio to dll.d, the program gives me
a segfault after it prints libdll.so shared static ~this. gdb
tells me the crash is in rt_finalize2(). The wiki page warns
about the multiple instances of the D runtime will conflict with
each other. Since I could delete my druntime from the lib
directory and still compile my .so file without errors the .so
file probably does not contain a version of the d runtime.
I've build ldc from the master branch in github using
-DBUILD_SHARED_LIBS=on using Xubuntu 14.04. Am I missing some
flags or is the shared library support not complete yet?
More information about the digitalmars-d-ldc
mailing list