www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - gdc shared library build

reply Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
Iain,

I suspect I have failed to: a) remember something I should know; and b)
discover something I should be able to find out from the webverse.
However:

I am trying to create a shared library. I have DMD and LDC command lines
that create a shared object without reporting errors (doesn't mean they
work though). Sadly GDC isn't playing ball with:

gdc -o libthingy.so -shared file.o

it is trying to link to the static libphobos2.a which is clearly going
to be a bit of a problem. Thus I have to specify forcing lookup in
libphobos2.so. Is this easy?
--=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
Sep 05 2014
next sibling parent reply "David Nadlinger" <code klickverbot.at> writes:
On Friday, 5 September 2014 at 17:14:30 UTC, Russel Winder via 
Digitalmars-d wrote:
 I am trying to create a shared library. I have DMD and LDC 
 command lines
 that create a shared object without reporting errors (doesn't 
 mean they
 work though).
Huh? If there are any issues with LDC shared libraries, please take a moment to report them. Thanks, David
Sep 05 2014
next sibling parent Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Fri, 2014-09-05 at 17:16 +0000, David Nadlinger via Digitalmars-d
wrote:
 On Friday, 5 September 2014 at 17:14:30 UTC, Russel Winder via=20
 Digitalmars-d wrote:
 I am trying to create a shared library. I have DMD and LDC=20
 command lines
 that create a shared object without reporting errors (doesn't=20
 mean they
 work though).
=20 Huh? If there are any issues with LDC shared libraries, please=20 take a moment to report them.
Indeed. I am just trying to get SCons to build things properly at the moment. Checking things actually work comes next :-) I do note that: dmd -of=3Dlibrary.so -shared -defaultlib=3Dlibphobos2.so code.o works fine, but for ldc2 I have to have: ldc2 -of=3Dlibrary.so -shared -defaultlib=3Dphobos2 code.o for ldc2 to work. I am not sure if this is as it should be or if one of DMD and LDC is wrong. --=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
Sep 05 2014
prev sibling parent Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Fri, 2014-09-05 at 17:16 +0000, David Nadlinger via Digitalmars-d
wrote:
 On Friday, 5 September 2014 at 17:14:30 UTC, Russel Winder via=20
 Digitalmars-d wrote:
 I am trying to create a shared library. I have DMD and LDC=20
 command lines
 that create a shared object without reporting errors (doesn't=20
 mean they
 work though).
=20 Huh? If there are any issues with LDC shared libraries, please=20 take a moment to report them.
=46rom my tinkerings, I cannot see any problems: DMD and LDC generated shared objects both behave as they should, which in this instance is to provide shared libraries with c linkage entry points usable from Python via ctypes of CFFI. --=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
Sep 05 2014
prev sibling parent reply Johannes Pfau <nospam example.com> writes:
Am Fri, 05 Sep 2014 18:14:20 +0100
schrieb Russel Winder via Digitalmars-d <digitalmars-d puremagic.com>:

  Thus I have to specify forcing lookup in
 libphobos2.so. Is this easy?
This is the easy part, but you also need a libgphobos2.so first ;-) As ketmar said this is not implemented in GDC yet. I've filed a pull request with some initial work, but I'm busy with other stuff right now so I can't finish it. https://github.com/D-Programming-GDC/GDC/pull/83 Main issues remaining: * Requires changes to binutils linker scripts to locate ModuleInfo. We need to decide whether we submit patches to binutils or try to find some other way (like in ldc or dmd). * There are some unresolved bugs with PIC codegen, 2 test cases fail.
Sep 05 2014
parent ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Fri, 5 Sep 2014 20:04:46 +0200
Johannes Pfau via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 * There are some unresolved bugs with PIC codegen, 2 test cases fail.
and some more bugs i sent to Iain directly by e-mail. one related to PIC and one to optimizer which removes some necessary code. but i believe that those are minor issues that will be sorted out. otherwise it is almost working. ;-)
Sep 05 2014