shared libs for OSX

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Mon May 25 23:30:51 PDT 2015


On 2015-05-25 21:40, bitwise wrote:

> So then I think I have a full solution:
> 1) _dyld_register_func_for_add_image should be taken care of with the
> above two fixes
> 2) __attribute__((constructor/destructor)) can be added to druntime when
> building for osx like in the file dylib_fixes.c [1]
> 3) copy paste rt_init/rt_term, rename them to dylib_init/dylib_term and
> remove everything except whats needed to initialize a shared lib's image.
>
> Does this make sense?

You plan to use  __attribute__((constructor)) instead of 
_dyld_register_func_for_add_image should?

As Marin said, you need to look at sections_osx.d and _d_dso_registry.

What do you plan to do about TLS?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list