osx shared libraries.

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 6 13:04:33 PDT 2015


On 6/6/2015 12:09 PM, bitwise wrote:
> On Sat, 06 Jun 2015 14:52:11 -0400, bitwise <bitwise.pvt at gmail.com> wrote:
>> Any ideas on this would be much appreciated.
>>
>> Thanks,
>>    Bit
>
> One thought that just occurred to me would be to require that D dynamic
> libraries contain a main entry point, like DllMain on Windows. This seems like
> the only real/reliable option.
>
> The coder would have to explicitly give dmd a module in which to place the
> constructor/destructor code for images, the same way that dmd adds a C-main in
> the file where D-main is found. Enforcing this in the future would be a breaking
> change, but not a dangerous one. It would be a simple link-time error which was
> easy to fix.
>
> Also, requiring all D binaries to have some kind of entry point would alleviate
> the need to ever call Runtime.initialize() explicitly.
>
>    Bit

Martin Nowak is the author of most of the OSX DLL support, but he seems to not 
be around lately.

I'd rather have a dynamic library entry point than put a constructor/destructor 
call into every object file.


More information about the Digitalmars-d mailing list