digitalmars.D - If I use an extern (C) interface, can I use shared objects in Linux
- Bernard Helyer (8/8) Dec 02 2011 I don't need to share GC memory across instances or anything,
- Jacob Carlborg (13/21) Dec 04 2011 I'm not sure if DMD outputs PIC correctly. This has recently been fixed:...
I don't need to share GC memory across instances or anything, but I would be interested in using a C interface if possible. If not, what's blocking it. If yes, how would one initialise the runtime? I know there's a Windows DLL article on the website, but I'm interested in Linux. I know GDC can do it for sure, but I'm interested in DMD's capabilities. Thanks, -Bernard.
Dec 02 2011
On 2011-12-02 15:13, Bernard Helyer wrote:I don't need to share GC memory across instances or anything, but I would be interested in using a C interface if possible. If not, what's blocking it. If yes, how would one initialise the runtime? I know there's a Windows DLL article on the website, but I'm interested in Linux. I know GDC can do it for sure, but I'm interested in DMD's capabilities. Thanks, -Bernard.I'm not sure if DMD outputs PIC correctly. This has recently been fixed: http://d.puremagic.com/issues/show_bug.cgi?id=4583 Don't know if there's any other problem with PIC. I'm pretty sure that compiler needs to be changed to use a different model for TLS. There are a couple of different TLS models available. There's one model that works anywhere for everything, then there are also models that only works for statically linked applications or only for dynamically linked applications. I don't know which model DMD uses. The runtime also needs to be modified to make sure module infos, exception handling tables and TLS are implemented correctly. -- /Jacob Carlborg
Dec 04 2011