www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - -defaultlib flags

When using dmd 2.070, in order to have a small fully dynamically linked
executable, I have to use the:


option for compilation of source to object and linking of objects to

When using ldc2 (compiled locally from the m-2.070 branch), I can have:


in the source to object compilation, but if I have this in the link
stage I get:

	/usr/bin/ld: cannot find -llibphobos2-ldc.so

which is sort of reasonable per se =E2=80=93 the lib and .so should not be =
the -l option. Now these libraries are not in a standard place so I
tried removing the -defaultlib option from the link and replaced it


but this appears to do nothing in that the link succeeds with or
without the option and the executable is the same size in both case,
and dynamically links to Phobos. I have the location of libphobos2-
ldc.so in my LD_LIBRARY_PATH at all times.

I am clearly misunderstanding something about dynamic linking and the
-defaultlib here, and in particular the difference between dmd and
ldc2. Is this a simple issue I am missing, or is it something needing
detail research?
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Mar 19 2016