building these 2 files to a library: ////////////////////////////////// module lib18456; __gshared int initVar; pragma(crt_constructor) extern(C) void mir_cpuid_crt_init() { initVar = 42; } ///////////////////////////////// module test18456b; class ManualGC { void enable() {} void disable() {} } with "dmd -m64 -oftest.a -lib test18456b.d test18456.d" produces a corrupt library that when linked with ///////////////////////////////// import lib18456; void main() { assert(initVar == 42); } via via "dmd -m64 test18456.d test.a" produces: /usr/bin/ld: error: test.a(lib18456.o): size of section .ctors is not multiple of address size /usr/bin/ld: final link failed: Bad value As the root corruption is not limited to use of pragma(crt_constructor), but just goes unnoticed otherwise, I've raised severity to "critical".
I can't reproduce this
I cannot reproduce it anymore, too. Might have been some intermediate version.