shared libs for OSX

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Fri May 22 09:04:24 PDT 2015


On Thursday, 21 May 2015 at 15:51:38 UTC, bitwise wrote:
> I'm not sure exactly what you mean about "integrated runtime".

I think he means Phobos/Druntime as shared library.

> Looking in /usr/share/dmd/lib, I see phobos as a static library 
> (which I'm assuming includes druntime, which I don't see 
> anywhere). If the runtime is linked as a static library, 
> shouldn't it be able to link to a dynamic library and just work?
>
> I think a separate runtime is what I was expecting.

Yes separate shared libraries (with multiple runtimes) work on 
every other platform.
The problem for OSX is that onAddImage gets called for the 
executable and every shared library. It would be trivial to only 
register the image containing the current runtime, by comparing 
the address of a private symbol with the memory region of the 
images.

https://github.com/D-Programming-Language/druntime/blob/6331ab1ae19f3ff82449a5734b59d81b128685f4/src/rt/sections_osx.d#L186


More information about the Digitalmars-d mailing list