https://issues.dlang.org/show_bug.cgi?id=16291
--- Comment #4 from Ketmar Dark <[email protected]> --- as nothing directly referring to module ctors, linker just doesn't know that it should not optimize 'em away. maybe we can fix that by emiting some flag for .o files, but i don't really know -- i never even read about dwarf object file format, so i'm not sure if such flag exists. that is, linker really does it's work here: if nothing directly using the symbol from object file, that object file is not linked to the final binary. tbh, i don't know how can we solve this: if we will mark all module ctors as "include always" (if it's possible), we will have alot of unnecessary (and probably unused) code linked to the final binary. it doesn't hurt much, but still... for now, easy fix is to move that thing back to "std.encoding", as it seems to not conflict with anything now. and probably create a new issue that documents this behavior. maybe we can introduce some UDA to mark modules that should not be optimized away by smartlinking, or something like that, 'cause i guess that similar issues are very possible in the future, as phobos becomes more and more complex, with complex interdependencies. --
