Minimal D Cross Compiler

Sean Kelly sean at f4.ca
Wed Sep 12 16:26:18 PDT 2007


Brian Madden wrote:
> 
> We're working on building our cross compiler toolchains BUT we're running in
> to problems left and right.  Most of us are on non-windows boxen, (about half
> are on macs, the other are running linux).
> 
> I've read a few different instructions on how to compile a D cross compiler,
> however since we're writing an OS we don't need any of the standard libraries,
> just the basics.

Assuming you aren't averse to the idea, Tango may be your best bet here. 
  See:

http://www.dsource.org/projects/tango/wiki/TopicAdvancedConfiguration
http://www.dsource.org/projects/tango/wiki/LibraryIntegrationGuide

What I'd do is stub out the common library and do something very minimal 
for the garbage collector.  Perhaps use this as a starting point:

http://www.dsource.org/projects/tango/browser/trunk/lib/gc/stub/gc.d

That should free you from the need to define almost any OS-level 
routines.  If I recall, the compiler runtime portion uses memset and a 
few similar routines for convenience, but these should be easily 
replaceable.

All this should at least strip out all unnecessary code from your 
application to get it up and running as quickly as possible.  I'm afraid 
I can't help much for cross-compilation, though it sounds like you'll be 
using GDC if that's the case.


Sean



More information about the Digitalmars-d mailing list