Is it possible to cross-compile D source code for MIPS?
For example, I want to compile a D "Hello, world." program that will run on TI AR7-based devices, which have MIPS32 processor and typically run Linux 2.4.17 kernel with MontaVista patches and uClibc (using the MIPS I generic target; ELF 32-bit LSB executable, MIPS, MIPS-I version 1 SYSV).
The reference compiler, DMD
, does not generate MIPS
code, so you'll have to use GDC
and LDC2
, which support generating code for whatever architectures their backends support (GCC
and LLVM
, respectively).
However, it's not a simple as generating the code. To get all of D's features workable, you'll need to port druntime
and phobos
to MIPS, as druntime
is quite architecture specific. Without that, you'll be stuck without a GC, and all the features that entails.
So it is possible, but how possible definitely depends on how dedicated you are.