On 08/12/13 06:25, H. S. Teoh wrote:
Yeah, this part bothers me too. Once I hacked up a script (well, a little D program :P) that disassembles D executables and builds a reference graph of its symbols. I ran this on a few small test programs, and was quite dismayed to discover that the mere act of importing std.stdio (for calling writeln("Hello World");) will introduce symbols from std.complex into your executable, even though the program has nothing to do with complex numbers. These symbols are never referenced from main() (i.e., the reference graph of the std.complex symbols are disjoint from the subgraph that contains _Dmain), yet they are included in the executable.
Do you have any idea why the std.complex symbols were pulled in, i.e. what dependencies were responsible? The only module that I'm aware of that imports std.complex is std.numeric, which is itself only imported by std.parallelism and std.random.
Are you sure it's not just the whole of Phobos being built in statically because you don't strip the binary?