How can I set up a D cross-compiler?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Layl
Posts: 4
Joined: Wed Nov 19, 2014 5:24 pm

How can I set up a D cross-compiler?

Post 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?
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

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

Post 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.
User avatar
Satoshi
Member
Member
Posts: 28
Joined: Thu Sep 13, 2012 2:18 pm

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

Post 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
Trinix (written in D) https://github.com/Rikarin/Trinix
Streaming OS development https://www.livecoding.tv/satoshi/
Layl
Posts: 4
Joined: Wed Nov 19, 2014 5:24 pm

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

Post 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.
Post Reply