Cross-compile with LDC

Oleg B via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 8 09:21:03 PST 2017


On Wednesday, 8 February 2017 at 16:21:49 UTC, kinke wrote:
> On Wednesday, 8 February 2017 at 14:57:41 UTC, Oleg B wrote:
>> Hello all! I want to build ldc cross compiller. I found this 
>> instruction  
>> https://wiki.dlang.org/LDC_cross-compilation_for_ARM_GNU/Linux, but I have some doubts: will it works with ldc-1.1.0? Particularly interested in the patch https://gist.githubusercontent.com/claudemr/3367c13095b15d449b1591eb38d098d9/raw/3517a5db2228e57da9dd8880a82d6bfe6f0e38f1/ldc_1.0.0_gnu_arm. It's for ldc-1.0.0 and sources can be changed.
>> Maybe somewhere I found patch for ldc-1.1.0?
>> Maybe someone already build cross ldc for linux x86_64?))
>
> Hi Oleg,
>
> first of all, we have an LDC forum/NG 
> (http://forum.dlang.org/group/ldc) which would be more 
> appropriate for your question. The referenced LDC patch is 
> derived from https://github.com/ldc-developers/ldc/pull/1317, 
> which hasn't been merged yet (but will be in not-too-distant 
> future).
> As you haven't explicitly specified what your target platform 
> is, I can only assume that it's 32-bit ARM. With a vanilla LDC, 
> cross-compiling to ARM with its double-precision reals will 
> only work correctly if your LDC host compiler uses 
> double-precision reals too, which isn't the case for Linux 
> x86(_64), but for Windows. My LDC PR would make it work with a 
> non-Windows x86(_64) host too, but only if the target (not the 
> host) uses at most double-precision reals.

Thank you, in future I create new question about ldc in special 
forum. Yes, my target arch is ARMv7 (rpi2 and beaglebone) and 
ARMv8 (rpi3). If I understand correctly with vanilla LDC I can't 
cross-compiling from host linux-x86_64, but with your patch I 
can. Right? Maximum precision for ARMv7(8) is 64bit doubles, for 
x86_64 is 80bit reals. If I use your patch must I use in my 
programs only double or I can stay real in existing code?


More information about the Digitalmars-d-learn mailing list