Cross-compile with LDC

Joakim via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 9 08:40:04 PST 2017


On Wednesday, 8 February 2017 at 17:57:49 UTC, kinke wrote:
> On Wednesday, 8 February 2017 at 17:21:03 UTC, Oleg B wrote:
>> If I understand correctly with vanilla LDC I can't 
>> cross-compiling from host linux-x86_64, but with your patch I 
>> can. Right?
>
> Right. Joakim Noah has worked on LDC for Android and as far as 
> I know provides some prebuilt compilers, a native one and a 
> cross-compiler (Linux x86_64 host) including that patch.
> There's also a pre-built Windows -> ARM cross-compiler; see 
> http://forum.dlang.org/thread/xzzzfvahuwvgslulifad@forum.dlang.org and more ARM-related threads in our subforum.

That's not really a Windows build of ldc, he just used the new 
linux support in Windows 10.  There is a build of ldc 1.1.0 for 
native linux/ARM, if you want to compile D code on the ARM device 
itself:

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

If not, it's pretty straight forward to build a cross-compiler 
for ARM, take a look at my patches and instructions for Android:

https://github.com/joakim-noah/android/releases

>> If I use your patch must I use in my programs only double or I 
>> can stay real in existing code?
>
> Don't worry, the reals can stay.

The patch will make reals the same as double, ie they're all 
64-bit, so it is irrelevant which one you use.  If you're writing 
cross-platform code and care about that difference on other 
platforms, you may need to check for it.  Take a look at std.math 
for examples of this, where it checks the length of the mantissa 
sometimes for reals.


More information about the Digitalmars-d-learn mailing list