All functions COMDAT on OSX

Marc Schütz via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 17 03:36:21 PST 2015


On Monday, 16 November 2015 at 17:59:21 UTC, bitwise wrote:
> Yeah... I'm wondering how much chaos it would cause to fix 
> this, because it's a blocking issue for fixing shared libs on 
> OSX.
>
> To support shared libraries, I'de have to add a unique linux 
> style global ctor/dtor to each module. LDC already does this. 
> There is no alternative solution.
>
> I could special case the ctor/dtors in DMD not to be COMDAT, 
> but the effect would be the same as fixing the bug anyways, 
> which would be that people would get linker errors if they 
> linked(or are currently linking) the same module multiple times 
> in their binary.
>
> This breakage is necessary to implement shared libraries, and 
> facilitate proper linking behaviour.

I'd say, just open a PR and see whether the auto-tester 
complains. If it works, then supporting shared libraries is worth 
the risk. Most likely it was just a workaround for a problem with 
an ancient version of OS X.


More information about the Digitalmars-d mailing list