is the runtime implemented in betterC?

kinke noone at nowhere.com
Sat Nov 9 22:46:16 UTC 2019


On Friday, 8 November 2019 at 15:25:40 UTC, dangbinghoo wrote:
> On Friday, 8 November 2019 at 13:52:18 UTC, kinke wrote:
>> On Friday, 8 November 2019 at 10:40:15 UTC, dangbinghoo wrote:
>>> hi,
>>
>> I'm not sure what you are trying to achieve; you can easily 
>> cross-compile druntime & Phobos with LDC, see 
>> https://wiki.dlang.org/Building_LDC_runtime_libraries.
>
> hmm, if runtime is implemented in regular D, how could the 
> regular D code depends on regular D runtime be compiled when we 
> doesn't have a D runtime even exists? thinking thant we just 
> have xtensa-llvm, and building ldc for xtensa CPU,  the runtime 
> will simply just not compiled.
>
> it's an egg-chicken problem?

This is getting confusing. You definitely don't need a prebuilt 
druntime to build the static druntime library, the dependency is 
at link-time, and then druntime just depends on other parts of 
itself. No chicken-egg problem.

It's still not clear to me what you are actually trying to 
achieve. If you are working on an x64 machine, have built a 
special xtensa-LLVM and built an LDC linked against that LLVM, 
you can cross-compile to that CPU. You can use the mentioned 
ldc-build-runtime tool to try to cross-compile druntime and 
Phobos (and optionally the testrunners). Then it's all about 
fixing the resulting compile errors (and link errors for the 
testrunners); most of the adaptations are in druntime, but you'll 
also have to slightly adapt the compiler (at least adding a new 
predefined version for the new CPU architecture).

druntime depends on OS, architecture and coupled C runtime - what 
OS are you going to target?


More information about the Digitalmars-d-learn mailing list