Building for ARM with LDC

Kai Nacke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Wed Aug 13 09:21:27 PDT 2014


Hi Joakim!

On Tuesday, 12 August 2014 at 04:51:00 UTC, Joakim wrote:
> On Tuesday, 12 August 2014 at 04:38:09 UTC, Kai Nacke wrote:
>> Hi Joakim!
>>
>> On Monday, 11 August 2014 at 09:44:56 UTC, Joakim wrote:
>>> On Saturday, 19 July 2014 at 18:51:16 UTC, Kai Nacke wrote:
>>>> Hi master!
>>>>
>>>> On Friday, 18 July 2014 at 13:32:44 UTC, master wrote:
>>>>>
>>>>> windows platform only two target?
>>>>>
>>>>
>>>> As there are still serious problems with cross compiling we 
>>>> do only provide binaries for x86 / x86_64 targets.
>>>>
>>>> As soon as I have fixed the floating point issue (see 
>>>> https://github.com/ldc-developers/ldc/pull/643) it makes 
>>>> sense to provide binaries with more targets.
>>>
>>> Can you make available whatever scripts/patches/config you're 
>>> currently using to cross-compile for ARM?  I want to try it 
>>> out, in preparation for getting Android/ARM working.
>>
>> For cross-compiling you need to use the pull request 643. 
>> Setting CC to the right gcc compiler (gcc-linux-arm) should be 
>> all you have to do.
>
> Thanks for the info, I'll try your pull request.
>
> What does setting CC to gcc-linux-arm do, invoke the ARM 
> linker?  How do I make sure druntime/phobos are compiled for 
> ARM?

Yes, the CC setting is used to invoke the linker.

> Just so it's clear, I want to compile ldc as a linux/x86 binary 
> that will generate ARM code on an x86 host, then compile 
> druntime, phobos, and their unit tests as ARM 
> libraries/binaries to deploy to an ARM target.

Cross-compiling druntime/phobos is possible but untried. You
could try to setup host and target compilers in CMakeList.txt or
you could build a small script to compile all .d modules into a
library. There is no out-of-the-box solution.
(Currently I build ldc on an ARM box and avoid the cross
compiling scenario.)

Regards,
Kai


More information about the digitalmars-d-ldc mailing list