LDC cross compilation wiki

Joakim via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sat Sep 9 12:27:38 PDT 2017


On Saturday, 9 September 2017 at 12:16:58 UTC, Andre Pany wrote:
> On Monday, 7 August 2017 at 15:49:02 UTC, Joakim wrote:
>> On Monday, 7 August 2017 at 13:34:09 UTC, Andre Pany wrote:
>>> Hi,
>>> While searching for LDC and cross compile, google shows as 
>>> first hit 
>>> https://wiki.dlang.org/LDC_cross-compilation_for_ARM_GNU/Linux
>>> Which is perfect.
>>>
>>> I just wonder whether the details are still valid:
>>> Llvm 3.8.0
>>> LDC 1.0
>>> ARM patch needed?
>>>
>>> Could someone with knowledge on this topic have a look?
>>
>> No, it's outdated and shouldn't be followed.  The next ldc 1.4 
>> beta will support cross-compiling the stdlib for arbitrary 
>> platforms, provided the requisite llvm CPU backend is included:
>>
>> https://github.com/ldc-developers/ldc/pull/2253
>>
>> I'm going to submit a PR so that all the flags there can be 
>> boiled down to two options, OS and arch, for platforms that we 
>> support.  You'll still be able to override anything with 
>> custom flags or configure it yourself for unsupported 
>> platforms.
>>
>> We'll add some docs for all this on the wiki when it's done, 
>> and redirect this page to those new instructions.
>
> I would try to use the ldc-build-runtime tool to cross compile 
> to my Raspberry Pi (From Windows). But by reading this wiki 
> page "https://wiki.dlang.org/Building_LDC_runtime_libraries" it 
> is not clear for me what to do.
>
> What is already working: Executing this command seems to finish 
> without error:
> C:\D\ldc2-1.4.0-beta1-win32-msvc\bin>ldc-build-runtime 
> --ldcSrcDir "ldc-1.4.0-beta1-src" --ninja
>
> But I think I have to call this command with specific 
> parameters for the Raspberry Pi. Where do I find this 
> parameters?
>
> Kind regards
> André

There are tutorials like this that seem to have some info:

http://gnutoolchains.com/raspberry/tutorial/

I've never used the RPi so I don't know what toolchains are out 
there.  You need a C toolchain for the RPi, then you specify the 
C compiler using CC, and the flags they tell you to use for 
compiling and linking get passed to ldc-build-runtime.

Hopefully, we'll eventually have a preset configuration for some 
popular RPi toolchain, but someone will have to submit a pull for 
that once my pull to keep a bunch of preset configurations for 
common platforms is in:

https://github.com/ldc-developers/ldc/pull/2301


More information about the digitalmars-d-ldc mailing list