dynamic library building and loading

Johannes Pfau nospam at example.com
Thu Sep 27 00:55:09 PDT 2012


Am Thu, 27 Sep 2012 08:26:36 +0200
schrieb "Daniel Kozak" <kozzi11 at gmail.com>:

> Now I try it, and it is not required to build shared variant of 
> druntime and phobos, only rebuild it with -fPIC
> 

In the end you'll probably need a shared druntime & phobos: Let's say
your main app doesn't use std.datetime and you statically link
libphobos. Then the linker might strip std.datetime from your
executable. If your shared library now needs std.datetime it won't
work.

The funny part is that on ARM+GDC we can at least build druntime &
phobos as a shared library, but on x86/64 last time I checked it didn't
work because of non-PIC assembly.

https://bitbucket.org/goshawk/gdc/issue/166/add-shared-lib-support


More information about the Digitalmars-d mailing list