Shared library with C API

Ellery Newcomer via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Jun 5 19:20:03 PDT 2014


On Wednesday, 4 June 2014 at 15:18:22 UTC, Dan Olson wrote:
>
> LDC also uses global ctors to build the ModuleInfo list.  A 
> problem with
> calling rt_init() in a global ctor means that ModuleInfo is 
> probably
> incomplete, meaning some or no module ctors (static this) are 
> called.  I
> thought perhaps the LDC_global_crt_ctor optional priority arg 
> could
> help, but makes no difference on OSX at least.

haven't noticed this on linux. I have noticed that druntime does 
not like it when you call rt_init or rt_term more than once, 
which kind of precludes multiple shared libs with this scheme.


More information about the digitalmars-d-ldc mailing list