www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Shared library support

reply John Colvin <john.loughran.colvin gmail.com> writes:
What is the state of shared library support across the different 
platforms that LDC supports? What is supposed to work currently 
and what is not?

I seem to be in a perennial state of "try it and see" with this, 
but that makes it hard to tell the difference between expected 
failures (not implemented yet), unexpected failures (something's 
broken) and user error. It would be really great if someone who 
really understand it could give me an overview :)
Jan 15
next sibling parent reply Guillaume Piolat <contact gam3sfrommars.fr> writes:
On Friday, 15 January 2016 at 14:46:35 UTC, John Colvin wrote:
 What is the state of shared library support across the 
 different platforms that LDC supports? What is supposed to work 
 currently and what is not?

 I seem to be in a perennial state of "try it and see" with 
 this, but that makes it hard to tell the difference between 
 expected failures (not implemented yet), unexpected failures 
 (something's broken) and user error. It would be really great 
 if someone who really understand it could give me an overview :)
On OSX it is supported and works (you can use TLS) BUT you can't unload them (same with DMD) and they need a workaround to work, see https://issues.dlang.org/show_bug.cgi?id=15060 This workaround make them leak but it's the only thing you can do so far. On Windows I didn't managed to export symbols: https://github.com/ldc-developers/ldc/issues/1158 Did someone managed to? On Linux I don't know where it stands.
Jan 15
parent Russel Winder via digitalmars-d-ldc <digitalmars-d-ldc puremagic.com> writes:
On Fri, 2016-01-15 at 16:29 +0000, Guillaume Piolat via digitalmars-d-
ldc wrote:
=20
[=E2=80=A6]
 On Linux I don't know where it stands.
=20
I build static and dynamic link versions of LDC for Debian Sid and Fedora Rawhide. Seems to all work tickety boo. Or perhaps that should have been hunky dory.=C2=A0 --=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
Jan 15
prev sibling parent Joakim <dlang joakim.fea.st> writes:
On Friday, 15 January 2016 at 14:46:35 UTC, John Colvin wrote:
 What is the state of shared library support across the 
 different platforms that LDC supports? What is supposed to work 
 currently and what is not?

 I seem to be in a perennial state of "try it and see" with 
 this, but that makes it hard to tell the difference between 
 expected failures (not implemented yet), unexpected failures 
 (something's broken) and user error. It would be really great 
 if someone who really understand it could give me an overview :)
Only Linux and FreeBSD shared libraries are officially supported and tested by druntime upstream: https://github.com/D-Programming-Language/druntime/blob/master/posix.mak#L97 Ldc piggybacks off Martin's shared library work and should support those two also. I believe all other platforms are in various incomplete states, at least as reported by others like Jacob and Guillaume.
Jan 16