Thread overview | ||||||
---|---|---|---|---|---|---|
|
September 23, 2017 how to build project with locally compiled phobos | ||||
---|---|---|---|---|
| ||||
hi all i've successfully compiled phobos master with gmake on freebsd. (make fails, i've no clue at all as to why) how do i compile my project now against my local phobos with dub? with plain dmd? i tried (in dub.sdl): - full path to new libphobos.so with -defaultlib to dflags - full path to new libphobos.so to lflags i checked with ldd and saw the original libphobos.so was used. my current workaround is copying mine to /usr/lib. thanks in advanced. |
September 23, 2017 Re: how to build project with locally compiled phobos | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mengu | On Saturday, 23 September 2017 at 11:58:40 UTC, Mengu wrote:
> hi all
>
> i've successfully compiled phobos master with gmake on freebsd. (make fails, i've no clue at all as to why)
>
> how do i compile my project now against my local phobos with dub? with plain dmd?
>
> i tried (in dub.sdl):
> - full path to new libphobos.so with -defaultlib to dflags
> - full path to new libphobos.so to lflags
>
> i checked with ldd and saw the original libphobos.so was used. my current workaround is copying mine to /usr/lib.
>
> thanks in advanced.
Hello, what you want to do is certainly possible but... I'd rather build a full custom dmd+runtime+phobos with its own sc.conf file Why ?
- Easier to invoke dub w/ the option --compiler=path.
- The custom DMD will alsways use the right phobos (when not using dub).
|
September 23, 2017 Re: how to build project with locally compiled phobos | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mengu | On Saturday, 23 September 2017 at 11:58:40 UTC, Mengu wrote: > hi all > > i've successfully compiled phobos master with gmake on freebsd. (make fails, i've no clue at all as to why) > > how do i compile my project now against my local phobos with dub? with plain dmd? > > i tried (in dub.sdl): > - full path to new libphobos.so with -defaultlib to dflags > - full path to new libphobos.so to lflags > > i checked with ldd and saw the original libphobos.so was used. my current workaround is copying mine to /usr/lib. > > thanks in advanced. try changing the dmd.conf file that is next to the dmd binary. My current one looks like [Environment] DFLAGS=-I~/d/druntime/import -I~/d/import -I~/d/phobos -L-L/Users/nicholaswilson/d/lib/ just change the -I and -L-L flags to the appropriate locations. or use the -conf switch (-conf=/path/to/newdmd.conf) |
September 23, 2017 Re: how to build project with locally compiled phobos | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mengu | On 23-09-17 13:58, Mengu wrote: > hi all > > i've successfully compiled phobos master with gmake on freebsd. (make fails, i've no clue at all as to why) > > how do i compile my project now against my local phobos with dub? with plain dmd? > > i tried (in dub.sdl): > - full path to new libphobos.so with -defaultlib to dflags > - full path to new libphobos.so to lflags > > i checked with ldd and saw the original libphobos.so was used. my current workaround is copying mine to /usr/lib. > > thanks in advanced. While you are linking with the phobos you compiled yourself with -defaultlib, ldd (and your binary) will pickup the one available in one of the paths configured for the run-time shared library loader. To actually make use of the phobos you compiled you also need to set the rpath. ``` -L-rpath=/path/to/phobos ``` Or use phobos as a static library. -- Mike Wey |
Copyright © 1999-2021 by the D Language Foundation