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 generateMIPScode, so you’ll have to useGDCandLDC2, which support generating code for whatever architectures their backends support (GCCandLLVM, respectively).However, it’s not a simple as generating the code. To get all of D’s features workable, you’ll need to port
druntimeandphobosto MIPS, asdruntimeis 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.