RejectedSoftware Forums

Sign up

set defaultlib

I need to set -defaultlib=libphobos2.so on linux. Can't use DFLAGS environment variable, since it doesn't seem to work (I guess the issue is this http://d.puremagic.com/issues/show_bug.cgi?id=1660).

DUB supports dflags, but as far as I can tell this only applies during the build step, whereas I need to set the switch during the link step.

Any workarounds for this currently?

Re: set defaultlib

Am 04.02.2014 07:05, schrieb cal:

I need to set -defaultlib=libphobos2.so on linux. Can't use DFLAGS environment variable, since it doesn't seem to work (I guess the issue is this http://d.puremagic.com/issues/show_bug.cgi?id=1660).

DUB supports dflags, but as far as I can tell this only applies during the build step, whereas I need to set the switch during the link step.

Any workarounds for this currently?

The separate compile/link build mode is kind of a strange beast. There
is currently a set of compiler flags which are automatically passed to
the link stage (e.g. -g or -m64). I'll add -defaultlib to this set.

Maybe a better/more generic approach would be to introduce an
"lcflags" field or similar, but I feel that this might be too
difficult to understand or too easy to get wrong when different build
modes/compilers/linkers/target types are involved...

Re: set defaultlib

On Tue, 04 Feb 2014 10:16:35 +0100, Sönke Ludwig wrote:

Am 04.02.2014 07:05, schrieb cal:

I need to set -defaultlib=libphobos2.so on linux. Can't use DFLAGS environment variable, since it doesn't seem to work (I guess the issue is this http://d.puremagic.com/issues/show_bug.cgi?id=1660).

DUB supports dflags, but as far as I can tell this only applies during the build step, whereas I need to set the switch during the link step.

Any workarounds for this currently?

The separate compile/link build mode is kind of a strange beast. There
is currently a set of compiler flags which are automatically passed to
the link stage (e.g. -g or -m64). I'll add -defaultlib to this set.

Should work now as of 569b5f0.

Re: set defaultlib

On Tue, 04 Feb 2014 09:22:36 GMT, Sönke Ludwig wrote:

On Tue, 04 Feb 2014 10:16:35 +0100, Sönke Ludwig wrote:
Should work now as of 569b5f0.

Thanks a lot, that's probably still the best way to go.