Phobos still being statically linked in?

Shriramana Sharma via Digitalmars-d digitalmars-d at puremagic.com
Sat Oct 17 03:00:17 PDT 2015


I went back to see my first post here in the D world two years ago:

http://forum.dlang.org/post/mailman.413.1369930723.13711.digitalmars-d-learn@puremagic.com

I had noted then with surprise that the most basic Hello World program took 
300K+ with rdmd, but now it seems it's much more i.e. 600K+ with dmd (since 
rdmd doesn't seem to leave out any executables any more). ldc2 is much 
better at 300K+ but still doesn't compare to C/C++...

$ cat namaste.d 
import std.stdio;
void main () { writeln("Namaste!"); }
$ dmd namaste.d && ls -l namaste*
-rwxrwxr-x 1 samjnaa samjnaa 645544 Oct 17 15:21 namaste
-rw-rw-r-- 1 samjnaa samjnaa     56 Oct 17 15:20 namaste.d
-rw-r--r-- 1 samjnaa samjnaa  14932 Oct 17 15:21 namaste.o
$ ldc2 namaste.d && ls -l namaste*
-rwxrwxr-x 1 samjnaa samjnaa 346144 Oct 17 15:21 namaste
-rw-rw-r-- 1 samjnaa samjnaa     56 Oct 17 15:20 namaste.d
-rw-rw-r-- 1 samjnaa samjnaa  25456 Oct 17 15:21 namaste.o
$ dmd --version
DMD64 D Compiler v2.068.2
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
$ ldc2 -version
LDC - the LLVM D compiler (0.16.0-beta2):
  based on DMD v2.067.1 and LLVM 3.7.0
  Default target: x86_64-unknown-linux-gnu
  Host CPU: haswell

I was told then 
(http://forum.dlang.org/post/op.wxwn0jys54xghj@puck.auriga.bhead.co.uk) that 
the reason was that the library was linked in statically.

Is this still true as it seems to be? If so, how do I tell dmd/ldc2 not to 
do that, but to use the available SO at:

/usr/lib/x86_64-linux-gnu/libphobos2.so.0.68.2

-- 
Shriramana Sharma, Penguin #395953


More information about the Digitalmars-d mailing list