www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - ldc depends on phobos

reply Joakim <dlang joakim.fea.st> writes:
I tried building ldc without linking against phobos and got a 
handful of link errors.  Has it been decided to selectively use 
phobos in the ldc compiler?

For example, pruneCache is implemented in D and called from 
codegenModules:

https://github.com/ldc-developers/ldc/blob/master/driver/main.cpp#L1122
https://github.com/ldc-developers/ldc/blob/master/driver/cache.cpp#L481
https://github.com/ldc-developers/ldc/blob/master/driver/cache_pruning.d#L28

The last file with the D implementation uses imports from phobos, 
it was added before the 1.1 release:

https://github.com/ldc-developers/ldc/pull/1753

There's another in the frontend:

https://github.com/ldc-developers/ldc/blob/master/ddmd/mtype.d#L2848

And finally, some functions from ddmd.builtin seem to call some 
std.math functions.
Oct 09 2017
parent reply Johan Engelen <j j.nl> writes:
On Monday, 9 October 2017 at 11:27:55 UTC, Joakim wrote:
 I tried building ldc without linking against phobos and got a 
 handful of link errors.  Has it been decided to selectively use 
 phobos in the ldc compiler?
Yes. (the requirement is that we should support "old" Phobos versions, LDC LTS 0.17 and upward) -Johan
Oct 09 2017
parent reply John Colvin <john.loughran.colvin gmail.com> writes:
On Monday, 9 October 2017 at 16:57:35 UTC, Johan Engelen wrote:
 On Monday, 9 October 2017 at 11:27:55 UTC, Joakim wrote:
 I tried building ldc without linking against phobos and got a 
 handful of link errors.  Has it been decided to selectively 
 use phobos in the ldc compiler?
Yes. (the requirement is that we should support "old" Phobos versions, LDC LTS 0.17 and upward) -Johan
So if I have an existing ldc installation, build a new ldc using the old one, linking to shared phobos, then install the new one over the old, I'll likely get runtime linker errors running the compiler due to incompatible Phobos versions?
Oct 09 2017
parent kinke <kinke gmx.net> writes:
On Tuesday, 10 October 2017 at 03:13:03 UTC, John Colvin wrote:
 On Monday, 9 October 2017 at 16:57:35 UTC, Johan Engelen wrote:
 On Monday, 9 October 2017 at 11:27:55 UTC, Joakim wrote:
 I tried building ldc without linking against phobos and got a 
 handful of link errors.  Has it been decided to selectively 
 use phobos in the ldc compiler?
Yes. (the requirement is that we should support "old" Phobos versions, LDC LTS 0.17 and upward) -Johan
So if I have an existing ldc installation, build a new ldc using the old one, linking to shared phobos, then install the new one over the old, I'll likely get runtime linker errors running the compiler due to incompatible Phobos versions?
Probably. Anyway, Phobos wouldn't be treated any different than druntime.
Oct 10 2017