https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104317
Siarhei Siamashka <siarhei.siamashka at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |siarhei.siamashka at gmail dot com --- Comment #2 from Siarhei Siamashka <siarhei.siamashka at gmail dot com> --- Created attachment 52322 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52322&action=edit proof of concept patch for gdc10 The attached proof of concept patch for GDC10 fixes the problem in a much less invasive way. The idea is to just use weak attributes for global variables in druntime instead of enclosing them in a "template {}" block. A preliminary pull request for upstream druntime is tracked here: https://github.com/dlang/druntime/pull/3716 The same simple fix also works fine for GDC11 if we undo PR99914: https://gist.github.com/ssvb/d8a67fb445e96f9e66d0516a3ba62475 I first tried to toggle "flag_weak_templates" in "gcc/d/lang.opt" from 1 to 0 in GDC11 instead of reverting PR99914, but the resulting toolchain was unable to compile and link even the most simple applications due to missing symbols from Phobos. The part preventing undesirable removal of cmdline arguments is cherry picked from: https://github.com/dlang/druntime/commit/ae9581c1e4b96de6707c71eb45dcc9c10dd4d402