Cross build for RPi2(3)

Joakim via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Wed Jun 7 14:28:18 PDT 2017


On Wednesday, 7 June 2017 at 18:20:11 UTC, Oleg B wrote:
> Hi, how I can build my project for RPi2 or 3 (armv7, armv8)?

You could build on the device itself, using the native ARM 
compiler here:

https://github.com/ldc-developers/ldc/releases/tag/v1.1.0

> By default ldc2-1.3.0-beta1 has no arm targets.
>
> LDC - the LLVM D compiler (1.3.0-beta1):
>   based on DMD v2.073.2 and LLVM 4.0.0
>   built with LDC - the LLVM D compiler (1.3.0-beta1)
>   Default target: x86_64-unknown-linux-gnu
>   Host CPU: skylake
>   http://dlang.org - http://wiki.dlang.org/LDC
>
>   Registered Targets:
>     x86    - 32-bit X86: Pentium-Pro and above
>     x86-64 - 64-bit X86: EM64T and AMD64
>
> Where I can get prebuilded ldc2 with arm target or ldc2 for 
> host arm?

You'd have to build the former yourself, the latter is linked 
above.

> And if I found ldc2 with arm target how to build for it's 
> target?

Depends how it's configured and packaged, but supplying the right 
llvm triple is usually what it takes.  See how it's done for 
Android (llvm triple not needed because llvm is built with it 
above):

https://wiki.dlang.org/Build_LDC_for_Android#Build_a_command-line_executable

> I need gcc and libs for arm, right?

Yes, you need those, depending on what you're trying to do.


More information about the digitalmars-d-ldc mailing list