ARM support

Johannes Pfau nospam at example.com
Sun Jan 12 04:38:19 PST 2014


Am Thu, 09 Jan 2014 19:07:17 +0100
schrieb Piotr Szturmaj <bncrbme at jadamspam.pl>:

> Hello,

Answers for GDC:
 
> I'm developing embedded system product on ARM9/Linux platform and I
> wish I could use D and vibe.d for this task.
> 

ARMv5 or ARMv4? I tested ARMv5 and that should work. ARMv4 should work
as well but is untested.


> I have couple of questions in this matter:
> - What is the current status of ARM support?

GDC is almost ready ready for a public beta.

Tested with Softfloat(no FPU)/Hardfloat on ARMv5/ARMv6:

* Compiler test suite passes as well as x86
* Druntime unittests pass
* Phobos tests pass except for std.math.internal.gammafunction which
  isn't ported yet

I mainly test using cross-compilers and haven't found any
cross-compiler issues so for (cross-compilers also pass all those test
mentioned above).

The remaining work is getting my changes upstreamed which will probably
take 2-4 weeks, then making a public beta with binaries for
cross-compilers. See
https://github.com/jpf91/GDC/tree/arm-old (old only means gcc-4.8
instead of gcc-4.9)

> - Does GDC support cross-compiling to ARM?
Yes, that works just fine. See http://wiki.dlang.org/GDC/Cross_Compiler
I use and recommend crosstool-NG.

> - Is it possible to remote-debug D code on ARM? (I've used GDB for
> C++ remote debugging on ARM11, I think this should also work with GDC 
> compiled code)

This should work just fine, but I didn't test it. Native debugging
works well. (GCC-4.8 emits dwarf4 by default. If your gdb doesn't
support dwarf4 you have to pass some flags to gdc to generate dwarf2)

> - Does druntime support ARM plaforms?
Yes (the druntime in gdc. We only upstream things that work for every
compiler so the upstream druntime is not complete. But as dmd doesn't
target ARM anyway...)

> - Does phobos support ARM plaforms?

Yes. Phobos is mostly CPU-architecture independent. The biggest
problem is usually floating point code which assumes real==80bit. But
Iain sorted out most of these issues, only
std.math.internal.gammafunction remains.

> - Does GC run reliably on ARM (or is it platform independent)?
Yes. It's basically CPU-arch independent. You need to tell it if the
stack grows upward/downwards and that's it.

It depends on the OS, but only for very few things (getting stack
bounds, TLS memory ranges etc). As longs as you use Linux/Glibc it
should work just fine.

> - Can you estimate eventual cost of supporting D on ARM (think of
> paid bounty).
 
Can't speak for anyone else but for me it's more a matter of missing
time than of money. Probably donating a board for the auto-tester could
help.


More information about the Digitalmars-d mailing list