LDC with ARM backend

Kai Nacke via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 15 08:24:36 PDT 2016


Hi Claude!

On Friday, 15 July 2016 at 14:09:40 UTC, Claude wrote:
> Hello,
>
> I would like to cross-compile a D program from a x86 machine to 
> an ARM target.
> [...]
> So I'm a bit confused of what the current state of LDC+ARM is. 
> For example, is the run-time fully ported on ARM/Linux?

LDC is fully ported to Linux/ARM. The current release also 
includes LDC pre-compiled for ARMv7 with hard floats (e.g. 
matches recent Raspberry hardware). On such a platform you can 
simply unpack the binary packages and LDC should run out of the 
box.

> What would be the steps to have an LDC cross-compiling to ARM?

That is a somewhat different story. First, you need to built LLVM 
with support for ARM and then compile LDC against this version of 
LLVM. You can run ldc2 -version to see if the ARM target is 
supported. As Radu already mentioned, most of the required steps 
are described in the wiki at 
https://wiki.dlang.org/Build_LDC_for_Android. From a different 
perspective there is an old news post about cross-compiling to 
AArch64, too: 
http://forum.dlang.org/post/fhwvxatxezkafnalwhqr@forum.dlang.org.

There is a reason why we do not distribute a binary version of 
LDC with all LLVM targets enabled. LDC still uses the real format 
of the host. This is different on ARM (80bit on Linux/x86 vs. 
64bit on Linux/ARM). Do not expect that applications using real 
type work correctly.
(The Windows version of LDC uses 64bit reals. The binary build 
has the ARM target enabled.)

Regards,
Kai


More information about the Digitalmars-d-learn mailing list