Compiling for ARM #116

Closed
thelastmammoth opened this Issue Jun 7, 2012 · 16 comments

7 participants

@thelastmammoth

I've seen old posts (latest ones were from january) regarding cross-compiling D for ARM, but back then it seemed the only solution was to use GDC, which seems to have some potential (see https://bitbucket.org/goshawk/gdc/wiki/GDC%20on%20Android : still some issues with druntime and phobos).

With LDC, isn't that supposed to be easier with the intermediate LLVM bytecode?
What is the current situation with LDC, and is there some planned (at least partial) support for compiling D for android or ios?

@klickverbot
LDC member

Unfortunately, as far as I know, none of the currently active developers are using LDC to target ARM, so I can't provide you with a good answer. What I know is that people have used (or at least tried to use) LDC to compile for ARM, so it should definitely be doable. If there are any specific roadblocks you hit, be sure to let us know, maybe we can still help.

Be aware, though, that most of the druntime/Phobos code is highly x86-specific, so definitely expect issues there – you might be able to build on prior work (like the linked GDC fork) here, though.

@klickverbot
LDC member

@alexrp is working on this.

@thelastmammoth

That's great news!

@klickverbot
LDC member

As far as I know, Alex is working mainly on getting the basic druntime facilities to work right now – you'd have to directly contact him for further details and/or coordination, though.

@alexrp

A couple of things that need to be done (once @klickverbot merges my initial patch set) is:

  • Fixing up the exception handling infrastructure for the ARM personality.
  • Implementing va_arg() for ARM.
  • Look into some weird R_ARM_ABS32 used with TLS symbol ... errors.
  • Actually run the test suites.

I have basically no idea how the va_arg() stuff should be done. I guess there is a formal ABI on this somewhere... As for EH, some investigation will have to be done to see what libstdc++ does for ARM.

Do note, I'm compiling/developing directly on my ARM device, not cross-compiling. I may look into cross-compiling later, but it's not very important for me.

@bioinfornatics

hi, what is the feature state?

@ithamsteri

I want help with ARM. LDC2 build correct on Raspeberry Pi with Arch Linux ARM, but build fail DRuntime.

@alexrp

I'll have another look at building LDC for armhf on my Efika MX soon...

@klickverbot
LDC member

@ithamsteri: Do you want help, or want to help? ;)

If the latter, the best way to do so would be to get a proper ARM EABI implementation done, see http://forum.dlang.org/post/lxnrjmflxsygcffsxixe@forum.dlang.org.

@klickverbot
LDC member

(I just arrived at home from DConf, and will post my druntime changes soon)

@klickverbot
LDC member

ARM changes will go in after 0.11.0 has been branched off.

@bioinfornatics

just to log a build on arm arch http://kojipkgs.fedoraproject.org//work/tasks/8541/5798541/build.log

fail of course

Any news are welcome :-)

@cicku

All errors are Error: undefined identifier va_list

@redstar
LDC member

That is no surprise. The base of a port of druntime is an implementation of core.stdc.stdarg and core.thread. Both modules are really essential.

@klickverbot
LDC member

LDC from Git master (5dc02c0) builds a working Phobos "Hello World" on ARM now (armv7l-unknown-linux-gnueabihf, cortex-a9).

There is still a lot of work to do, e.g. EH is completely broken (see #489), and cross compiling has not been tested yet (#490).

I'm closing this umbrella ticket, please open individual bug reports for any specific issues you might run into.

@klickverbot klickverbot closed this Oct 6, 2013
@bioinfornatics

Thanks a lot klickverbot, nice job :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment