digitalmars.D - rpath options to linkers, OSX issue
- Russel Winder via Digitalmars-d (24/24) Sep 06 2014 Ariovistus originally reported Issue 2940 against SCons and the D
- Mike Wey (8/22) Sep 07 2014 Windows doesn't support rpath or something like it, the best alternative...
- Russel Winder via Digitalmars-d (19/24) Sep 07 2014 =20
- Jacob Carlborg (4/14) Sep 07 2014 It works for me with "-rpath .", note the absence of the equals sign.
- Russel Winder via Digitalmars-d (20/35) Sep 07 2014 c
- Jacob Carlborg (4/6) Sep 07 2014 Note that dynamic libraries don't work properly on OS X.
- Russel Winder via Digitalmars-d (15/21) Sep 07 2014 D has no libphobos.so on OSX, at least not with the MacPorts
- Andrei Alexandrescu (2/6) Sep 07 2014 What are the issues? -- Andrei
- Jacob Carlborg (5/6) Sep 08 2014 The usual: module info, exception handling tables, TLS and so on. Same
- David Nadlinger (8/10) Sep 07 2014 Just FYI, the linker, as in the ld binary, is not part of Clang.
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
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
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==20there 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
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
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:cAriovistus originally reported Issue 2940 against SCons and the D toolset (http://scons.tigris.org/issues/show_bug.cgi?id=3D2940). The gd=rtool 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=esdmd. 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=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"-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.
Sep 07 2014
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
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: =20D 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_winderIs 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.
Sep 07 2014
On 9/7/14, 6:07 AM, Jacob Carlborg wrote:On 2014-09-06 17:51, Russel Winder via Digitalmars-d wrote:What are the issues? -- AndreiIs 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.
Sep 07 2014
On 07/09/14 22:23, Andrei Alexandrescu wrote:What are the issues? -- AndreiThe 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
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