www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - rpath options to linkers, OSX issue

reply Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
Ariovistus originally reported Issue 2940 against SCons and the D
toolset (http://scons.tigris.org/issues/show_bug.cgi?id=3D2940). The gdc
tool uses "-Wl,-rpath=3D." in the gdc command to set the rpath for gdc.
The dmd tool uses "-L-rpath=3D." in the dmd command to set the rpath for
dmd.

This all works fine on Linux. I haven't managed to find a way to test
this on Windows.

It seems for the first time (which surprised me as I thought I had
checked this), I am running the tests on OSX and "-L-rpath=3D." generates
"-rpath=3D." to the ld which is Clang and it rejects this option.

I am assuming the problem is in my OSX set up and not in what dmd is
doing. I get dmd via MacPorts, it is v2.066-devel.

Is there an OSX user out there having no problem with dmd and dynamic
libraries I can prevail upon to give me a hand with this?=20

--=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 06 2014
next sibling parent reply Mike Wey <mike-wey example.com> writes:
On 09/06/2014 05:51 PM, Russel Winder via Digitalmars-d wrote:
 Ariovistus originally reported Issue 2940 against SCons and the D
 toolset (http://scons.tigris.org/issues/show_bug.cgi?id=2940). The gdc
 tool uses "-Wl,-rpath=." in the gdc command to set the rpath for gdc.
 The dmd tool uses "-L-rpath=." in the dmd command to set the rpath for
 dmd.

 This all works fine on Linux. I haven't managed to find a way to test
 this on Windows.

 It seems for the first time (which surprised me as I thought I had
 checked this), I am running the tests on OSX and "-L-rpath=." generates
 "-rpath=." to the ld which is Clang and it rejects this option.

 I am assuming the problem is in my OSX set up and not in what dmd is
 doing. I get dmd via MacPorts, it is v2.066-devel.

 Is there an OSX user out there having no problem with dmd and dynamic
 libraries I can prevail upon to give me a hand with this?
Windows doesn't support rpath or something like it, the best alternative there would be using "SetDllDirectory" or "AddDllDirectory" in the executable. For OSX this might help: http://stackoverflow.com/questions/4513799/how-to-set-the-runtime-path-rpath-of-an-executable-with-gcc-under-mac-osx -- Mike Wey
Sep 07 2014
parent Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Sun, 2014-09-07 at 10:39 +0200, Mike Wey via Digitalmars-d wrote:
[=E2=80=A6]
 Windows doesn't support rpath or something like it, the best alternative=
=20
 there would be using "SetDllDirectory" or "AddDllDirectory" in the=20
 executable.
OK, I'll have to get some help on this as when it comes to Windows I have no idea, and indeed no compiler/linker other than MinGW gcc.
 For OSX this might help:=20
 http://stackoverflow.com/questions/4513799/how-to-set-the-runtime-path-rp=
ath-of-an-executable-with-gcc-under-mac-osx Hummm=E2=80=A6 I'll tinker with this for the MacPorts gcc, but the problem = is whether Clang has support for this as almost everyone uses Xcode. --=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 07 2014
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2014-09-06 17:51, Russel Winder via Digitalmars-d wrote:
 Ariovistus originally reported Issue 2940 against SCons and the D
 toolset (http://scons.tigris.org/issues/show_bug.cgi?id=2940). The gdc
 tool uses "-Wl,-rpath=." in the gdc command to set the rpath for gdc.
 The dmd tool uses "-L-rpath=." in the dmd command to set the rpath for
 dmd.

 This all works fine on Linux. I haven't managed to find a way to test
 this on Windows.

 It seems for the first time (which surprised me as I thought I had
 checked this), I am running the tests on OSX and "-L-rpath=." generates
 "-rpath=." to the ld which is Clang and it rejects this option.
It works for me with "-rpath .", note the absence of the equals sign. -- /Jacob Carlborg
Sep 07 2014
parent Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Sun, 2014-09-07 at 15:05 +0200, Jacob Carlborg via Digitalmars-d
wrote:
 On 2014-09-06 17:51, Russel Winder via Digitalmars-d wrote:
 Ariovistus originally reported Issue 2940 against SCons and the D
 toolset (http://scons.tigris.org/issues/show_bug.cgi?id=3D2940). The gd=
c
 tool uses "-Wl,-rpath=3D." in the gdc command to set the rpath for gdc.
 The dmd tool uses "-L-rpath=3D." in the dmd command to set the rpath fo=
r
 dmd.

 This all works fine on Linux. I haven't managed to find a way to test
 this on Windows.

 It seems for the first time (which surprised me as I thought I had
 checked this), I am running the tests on OSX and "-L-rpath=3D." generat=
es
 "-rpath=3D." to the ld which is Clang and it rejects this option.
=20 It works for me with "-rpath .", note the absence of the equals sign.
So does that mean giving DMD the option -L"-rpath ." would this work for Linux I wonder instead of: -L-path=3D. I feel an experiment coming on! --=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 07 2014
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2014-09-06 17:51, Russel Winder via Digitalmars-d wrote:

 Is there an OSX user out there having no problem with dmd and dynamic
 libraries I can prevail upon to give me a hand with this?
Note that dynamic libraries don't work properly on OS X. -- /Jacob Carlborg
Sep 07 2014
next sibling parent Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Sun, 2014-09-07 at 15:07 +0200, Jacob Carlborg via Digitalmars-d
wrote:
 On 2014-09-06 17:51, Russel Winder via Digitalmars-d wrote:
=20
 Is there an OSX user out there having no problem with dmd and dynamic
 libraries I can prevail upon to give me a hand with this?
=20 Note that dynamic libraries don't work properly on OS X.
D has no libphobos.so on OSX, at least not with the MacPorts distribution of D, so clearly it won't actually work, but I shouldn't be getting fails of options to Clang even with no hope of overall success. --=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 07 2014
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 9/7/14, 6:07 AM, Jacob Carlborg wrote:
 On 2014-09-06 17:51, Russel Winder via Digitalmars-d wrote:

 Is there an OSX user out there having no problem with dmd and dynamic
 libraries I can prevail upon to give me a hand with this?
Note that dynamic libraries don't work properly on OS X.
What are the issues? -- Andrei
Sep 07 2014
parent Jacob Carlborg <doob me.com> writes:
On 07/09/14 22:23, Andrei Alexandrescu wrote:

 What are the issues? -- Andrei
The usual: module info, exception handling tables, TLS and so on. Same problem Linux used to have. It has only be solved for Linux. -- /Jacob Carlborg
Sep 08 2014
prev sibling parent "David Nadlinger" <code klickverbot.at> writes:
On Saturday, 6 September 2014 at 15:52:03 UTC, Russel Winder via 
Digitalmars-d wrote:
 I am running the tests on OSX and "-L-rpath=." generates
 "-rpath=." to the ld which is Clang and it rejects this option.
Just FYI, the linker, as in the ld binary, is not part of Clang. Instead, Apple have their own "ld64" linker: http://www.opensource.apple.com/source/ld64/. Of course, DMD invokes it via "gcc", which tends to be Clang on newer systems. As for your actual question, I think "-L-rpath -L." should work. David
Sep 07 2014