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:

	-defaultlib=3Dlibphobos2.so

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

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

	-defaultlib=3Dlibphobos2-ldc.so

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 =
in
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
with:

	-L-lphobos2-ldc

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?
.
--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
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