iphone + LDC, a new ARM adventure

David Nadlinger code at klickverbot.at
Tue Feb 11 17:14:38 PST 2014


On Mon, Feb 10, 2014 at 5:39 PM, Dan Olson
<zans.is.for.cans at yahoo.com> wrote> Works
> ../buildldc/bin/ldc2 -c ../ldc-git/runtime/druntime/src/core/demangle.d -mtriple=thumbv7-apple-darwin -float-abi=softfp -O
>
> Fails
> ../buildldc/bin/ldc2 -c ../ldc-git/runtime/druntime/src/core/demangle.d -mtriple=thumbv7-apple-darwin -O
>
> […]
>
> It has something to do with TargetOptions UseSoftFloat = 1.
>
> I can file an issue if you like.  Perhaps it is an llvm bug though.

Ah, yes, that's not really surprising. Unimplemented floating point
lowerings tend to be responsible for a good share of strange error
messages when targeting non-x86 platforms with LLVM, in my experience.

The decision whether to use "soft", "softfp" or "hard" by default is
(unfortunately) made in the LDC driver code, based on the target
triple: https://github.com/ldc-developers/ldc/blob/master/driver/targetmachine.cpp.
The logic is supposed to mirror what Clang does, but maybe I missed
something. I'd definitely double-check the behavior against Clang,
although this should really be moved into an LLVM support library –
every flexible ARM compiler is going to need something similar.

Another potential cause is that "thumbv7-apple-darwin" might not be
the right target triple for iOS (thus leading to hardware floating
point support being incorrectly disabled), but I'd have to reboot into
OS X to check right now.

Best,
David



More information about the digitalmars-d-ldc mailing list