Page 1 of 1

How can I set up a D cross-compiler?

Posted: Wed Nov 19, 2014 5:54 pm
by Layl
I've run through the basic Bare Bones tutorial and had a buncha fun implementing my own kernel text output in C++11. Currently I've set up my GCC cross compiler on an ubuntu VM (a clean install for good measure) and everything is working great so far.

However, now I want to switch over to the D language for my kernel programming instead. The tutorial on the wiki on the D language does not mention anything about setting up a cross-compiler for D and I'm not sure what direction I should look in for doing this.

The page on cross compiling for any generic target on the wiki for D shows I need a c library implementation if I read it right, but how can I implement everything in the c library without even having the kernel itself up and running?

Even more, the xomb build script on github show it uses "ldc" (still without a specific target in the name, even though it does have it for "x86_64-pc-elf-gcc") rather than the "gdc" mentioned on the D Bare Bones article and anywhere else I've seen where D code is compiled.

Could someone help me shed some light on how I can set this up or if I have to set up a D cross compiler at all?

Re: How can I set up a D cross-compiler?

Posted: Wed Nov 19, 2014 6:00 pm
by sortie
I never looked into this, but I imagine you want to look at --enable-language to configure and the top-level make targets.

Re: How can I set up a D cross-compiler?

Posted: Wed Nov 19, 2014 6:50 pm
by Satoshi
Hi, You just need to download GDC front-end and run setup-gcc.sh to your existing GCC cross compiler. And disable or port garbage collector in druntime library. But if you disable GC you cannot use some D funcs without memory leaks.

Last week I seccessfuly built up GDC cross compiler for my OS.
https://github.com/Bloodmanovski/Trinix ... ssCompiler

Re: How can I set up a D cross-compiler?

Posted: Wed Nov 19, 2014 7:16 pm
by Layl
Bloodman wrote:Hi, You just need to download GDC front-end and run setup-gcc.sh to your existing GCC cross compiler. And disable or port garbage collector in druntime library. But if you disable GC you cannot use some D funcs without memory leaks.

Last week I seccessfuly built up GDC cross compiler for my OS.
https://github.com/Bloodmanovski/Trinix ... ssCompiler
Thanks, especially the example makefile helps a lot with getting this set up.