Hitchikers Guide to Porting Phobos / D Runtime to other architectures

Sean Kelly sean at invisibleduck.org
Mon Jan 6 09:52:43 PST 2014


On Monday, 6 January 2014 at 11:47:57 UTC, Dwhatever wrote:
> I'm trying to do the same, trying to compile OS free code but I 
> haven't so far been successful because D requires the runtime 
> and then also Phobos.

D doesn't require Phobos.  The compiler implicitly links against
libphobos.a, but that isn't the same thing.  All a D app actually
needs is Druntime.  And you can replace the GC in Druntime with
gcstub (backed by malloc) and stub out the thread API if these
aren't appropriate for your target.  This still means using a
custom Druntime, but making the changes should really be pretty
straightforward in most cases.  The most complicated aspect of
porting will be how you handle core.stdc, since Druntime still
relies on C library calls for various things.


More information about the Digitalmars-d mailing list