strange bug: (not) calling module ctors; help with "master" needed

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 19 08:08:24 PDT 2016


i'm using git master (updated daily), and recently found very 
strange thing.

when i'm linking my programs with libphobos2.a, module ctor from 
"std.internal.phobosinit" is not called, but when i'm linking 
with .so, everything is ok.

it is easy to check: `EncodingScheme.create("utf-8")` will fail 
if ctor is not called (as all that ctor does currently is 
registering codecs from std.encoding).

i guess that not many people is using that, so it may slip 
unnoticed for some time. that, or something is very wrong with my 
local system (which is possible too, of course).

so please, if somebody can build dmd master and check it to 
confirm (i hope ;-) the results, i'd be very grateful.

my system is 32-bit GNU/Linux, with gold linker.

switching between libs is done in dmd.conf, with:
DFLAGS=-defaultlib=libphobos2.a
or
DFLAGS=-defaultlib=libphobos2.so


More information about the Digitalmars-d-learn mailing list