Ehem, ARM

Joakim joakim at airpost.net
Fri Nov 15 10:40:04 PST 2013


On Friday, 15 November 2013 at 12:07:19 UTC, Martin Nowak wrote:
> On Friday, 15 November 2013 at 09:20:18 UTC, Joakim wrote:
>> For one, dmd not having an ARM backend doesn't impact me since 
>> I'm targeting Android/x86 for now, :) as stated earlier.
>
> Interesting, then you'll mostly focus on druntime and glibc vs. 
> bionic issues.
> The linux/ELF support of dmd should mostly work.

Yes, I thought that would be easier, to split the effort into two 
parts.  First, get D working on Android/x86, then, linux/ARM.  
Some fine day, we combine the two into Android/ARM. :)

On Friday, 15 November 2013 at 12:18:20 UTC, Kai Nacke wrote:
> Hi Joakim!
>
> Yes, there is a some support, but not too much. The existence 
> of the TARGET_* macros means that you can't have one compiler 
> with 2 or more platform targets.

I think what I'll try initially is to hack the linux target on 
dmd to produce an Android/ELF/x86 executable, by tying into the 
Android NDK and linker.  That might be the shortest path to 
something that works.

> But there should be no real problem to create a dmd executable 
> on Linux/ARM producing object files for Windows/x86. (Well - no 
> problem except for the real data type. :-) ) But who needs that 
> kind of cross-compiling?

Maybe not linux/ARM, but if D ever takes off, I could see it 
being convenient someday to cross-compile Windows/x64 executables 
on linux/x64 servers, perhaps by tying into Wine. I have compiled 
a small Windows utility using dmd under Wine on a FreeBSD host 
before: it worked. :) You wouldn't need to license Windows for a 
bunch of build servers and could cut costs that way.  Obviously 
not a concern today, but we should get cross-compiling working as 
much as possible and cross-compiling to Android might be a good 
first step.  Hell, by then, linux/ARM might be prevalent in the 
data center. ;)

> To be useful for producing ARM binaries, you need an ARM 
> backend. This is already available for LDC and GDC. IMHO it is 
> easier to pick one of those compilers and think about and 
> create a cross-compiling environment instead of starting by 
> zero. (For LDC, this is issue #490: 
> https://github.com/ldc-developers/ldc/issues/490)

I'm only focusing on Android/x86 for now: why does everyone keep 
bringing up ARM?  It's almost as though Android/x86 gets 
translated into Android/ARM in their head. ;) Perhaps it is 
easier to cross-compile with ldc/gdc, or perhaps the overall port 
will be harder because I have to then dive into those larger 
llvm/gcc codebases, whereas the dmd backend looks simpler to me, 
at least so far.  I'll give it a whirl with dmd first and then 
move to ldc if I get stuck.

Thanks for the advice, I may end up following it.


More information about the Digitalmars-d mailing list