[Issue 20248] Module constructors in executable called twice, never in loaded shared library
https://issues.dlang.org/show_bug.cgi?id=20248 Iain Buclaw changed: What|Removed |Added Priority|P1 |P2 --
[Issue 20248] Module constructors in executable called twice, never in loaded shared library
https://issues.dlang.org/show_bug.cgi?id=20248 --- Comment #3 from kinke --- There's a related issue regarding CRT ctors - if both executable and library contain an identically mangled `pragma(crt_constructor)` function (doesn't even need to be in the same module - and name collision is quite likely due to the `extern(C)` requirement...), the executable one is invoked twice. Again DMD-specific, works with LDC. --
[Issue 20248] Module constructors in executable called twice, never in loaded shared library
https://issues.dlang.org/show_bug.cgi?id=20248 kinke changed: What|Removed |Added Keywords||backend Component|druntime|dmd Hardware|x86_64 |All --
[Issue 20248] Module constructors in executable called twice, never in loaded shared library
https://issues.dlang.org/show_bug.cgi?id=20248 --- Comment #2 from kinke --- Further tests have shown that with DMD, the ModuleInfos of modules contained in both executable and library are apparently resolved to the executable's. E.g., versioning out the module ctor in `modcon2.d` for the library still leads to it being invoked when loading the library; the opposite case, versioning it out for the executable, means it's not invoked at all. --
[Issue 20248] Module constructors in executable called twice, never in loaded shared library
https://issues.dlang.org/show_bug.cgi?id=20248 kinke changed: What|Removed |Added CC||ki...@gmx.net --- Comment #1 from kinke --- This 'works' with LDC v1.27 (but DMD v2.097 still fails): 0x55debef38074 0x55debef34090 HI 0x7fdfb6c12064 0x7fdfb6c10870 I think this is more likely related to compiler differences wrt. relocation model, not a druntime divergence. --
[Issue 20248] Module constructors in executable called twice, never in loaded shared library
https://issues.dlang.org/show_bug.cgi?id=20248 John Colvin changed: What|Removed |Added Keywords||industry, wrong-code --
[Issue 20248] Module constructors in executable called twice, never in loaded shared library
https://issues.dlang.org/show_bug.cgi?id=20248 John Colvin changed: What|Removed |Added Summary|Module constructors in |Module constructors in |executable called twice, in |executable called twice, ||never in loaded shared ||library --