https://issues.dlang.org/show_bug.cgi?id=15060
--- Comment #12 from bitwise <[email protected]> --- (In reply to Jacob Carlborg from comment #10) > (In reply to ponce from comment #9) > > If this need back-end support, maybe Walter could implement global ctor/dtor > > like in LDC? > > DMD already does what's necessary for ELF (Linux, FreeBSD). Just do the same > for Mach-O and OS X. >> DMD already does what's necessary for ELF (Linux, FreeBSD). Just do the same >> for Mach-O and OS X. That's easier said than done ;) Making druntime compile as a shared lib and making it support multiple images is the easy part. Modifying DMD to output the ctors/dtors properly is much more difficult than it sounds. The current solution outputs the ctors/dtors by manually outputting byte codes: https://github.com/D-Programming-Language/dmd/blob/master/src/backend/elfobj.c#L3183 This is why I was saying we should just add some(or one special one) pragmas that will allow this to be done in the front end. >> @bitwise: how much would you take to do it? :)) Wish I knew how =/ --
