Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
January 21, 2014 Re: DMD via MacPorts has a problem | ||||
---|---|---|---|---|
| ||||
El 21/01/14 20:44, Russel Winder ha escrit: > I have used the command: > > dmd -shared -defaultlib=libphobos2.so -oflibsayhello.so source/sayHello.o -L-L. > > successfully on Debian Unstable using the dmd-bin and libphobos2-dev debs from d-apt. However on OSX using the dmd and phobos ports as provided via MacPorts: > > dmd -shared -defaultlib=libphobos2.so -oflibsayhello.so > source/sayHello.o -L-L. > ld: library not found for -llibphobos2.so > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > --- errorlevel 1 > > It seems that the phobos port only installs the static archive and not the dynamic library. > > I appreciate the library should probably be called libphobos2.dylib rather than libphobos2.so on OSX but that is not provided. > "libphobos2.so" for OSX is not yet available. You should use "libphobos2.a". BTW This thread is provably for: digitalmars-d-learn@puremagic.com -- Jordi Sayol |
January 22, 2014 Re: DMD via MacPorts has a problem | ||||
---|---|---|---|---|
| ||||
On Tue, 2014-01-21 at 21:06 +0100, Jordi Sayol wrote: […] > "libphobos2.so" for OSX is not yet available. You should use "libphobos2.a". libphobos2.a is not compiled with PIC code on Linux and OSX so is not usable for creating shared libraries, it has to be libphobos.so. > BTW This thread is provably for: digitalmars-d-learn@puremagic.com Uurrr… on what grounds? -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 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 |
January 22, 2014 Re: DMD via MacPorts has a problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On Wednesday, 22 January 2014 at 18:20:45 UTC, Russel Winder wrote:
> On Tue, 2014-01-21 at 21:06 +0100, Jordi Sayol wrote:
> […]
>> "libphobos2.so" for OSX is not yet available. You should use "libphobos2.a".
>
> libphobos2.a is not compiled with PIC code on Linux and OSX so is not
> usable for creating shared libraries, it has to be libphobos.so.
>
>> BTW This thread is provably for: digitalmars-d-learn@puremagic.com
>
> Uurrr… on what grounds?
Shared libraries are simply not yet supported on OS X, at least not to the same level as on Linux.
David
|
January 23, 2014 Re: DMD via MacPorts has a problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On 2014-01-22 19:20, Russel Winder wrote: > libphobos2.a is not compiled with PIC code on Linux and OSX so is not > usable for creating shared libraries, it has to be libphobos.so. PIC is the default on OS X. But as David said, dynamic libraries are not properly implemented on OS X yet in DMD (or any other D compiler). -- /Jacob Carlborg |
March 04, 2014 Re: DMD via MacPorts has a problem | ||||
---|---|---|---|---|
| ||||
On Tue, 2014-03-04 at 09:23 +0900, Takeshi Enomoto wrote: […] > I updated dmd, druntime, phobos, dmd-doc and dmd-tools to 2.065.0 and have just committed the changes. Sponditious. They work for me fine on a MBP with OSX Mavericks. However on a white MB with OSX Lion (*) the install of DMD fails. The problem appears to be that Clang cannot link the object files since the object files are not built for x86 architecture – despite the processor being 64-bit, the boot prom is 32-bit and so OSX is 32-bit and reports the processor to be 32-bit, unlike the processor which knows it's 64-bit and reports so. As far as I can tell (log files are huge due to the huge numbers of warnings about expressions) all the clang++ lines have -DDM_TARGET_CPU_X86, so I am somewhat surprised. Of course I am really a Linux person being forced to set up OSX boxes for testing… > While updating Portfiles, I tried to build a shared library of druntime. It turned out that I can't do so because druntime-2.065/src/rt/sections.d line 48 > > static assert(is(typeof(&pinLoadedLibraries) == void* function())); > > returns an error and a dylib is not created. > This is because pinLoadedLibraries() is not defined in rt.sections_osx.d. > > I suggest to ask dmd developers to support shared libraries on OS X. I think this is a core problem for D in general: everyone needs or wants shared libraries, but… (*) Apple refuse to allow any upgrade of this hardware to OSX Mountain Lion or OSX Mavericks, so I am stuck with OSX Lion. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 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 |
March 04, 2014 Re: DMD via MacPorts has a problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On 2014-03-04 15:29, Russel Winder wrote: > Sponditious. > > They work for me fine on a MBP with OSX Mavericks. > > However on a white MB with OSX Lion (*) the install of DMD fails. The > problem appears to be that Clang cannot link the object files since the > object files are not built for x86 architecture – despite the processor > being 64-bit, the boot prom is 32-bit and so OSX is 32-bit and reports > the processor to be 32-bit, unlike the processor which knows it's 64-bit > and reports so. As far as I can tell (log files are huge due to the huge > numbers of warnings about expressions) all the clang++ lines have > -DDM_TARGET_CPU_X86, so I am somewhat surprised. Of course I am really a > Linux person being forced to set up OSX boxes for testing… I have no idea how Macport compiles DMD but I have no problem in compiling DMD manually, either with a 64bit or 32bit kernel. If the computer supports it, you can force OS X to boot either a 32bit or 64bit kernel [1]. > (*) Apple refuse to allow any upgrade of this hardware to OSX Mountain > Lion or OSX Mavericks, so I am stuck with OSX Lion. I'm pretty sure there are ways around that. [1] http://support.apple.com/kb/ht3773 -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation