iphone + LDC, a new ARM adventure

Dan Olson zans.is.for.cans at yahoo.com
Mon Feb 10 08:39:47 PST 2014


"Kai Nacke" <kai at redstar.de> writes:

> Hi Dan!
>
> On Wednesday, 5 February 2014 at 07:32:05 UTC, Dan Olson wrote:
>>
>> The todo list will look something like:

>> - figure out ldc codegen assertion errors for armv7/thumbv7 so can
>> ditch
>>    the ldc/llc 2-phase approach.
>>
>
> And if you still encounter ldc crashes, please report them. Even if I
> can't help on iOS right know I still can make sure that you have a
> stable environment.

I discovered the ldc (llvm codegen assertion failures) happen when float
abi is soft for triples armv7-apple-darwin or thumbv7-apple-darwin.

Thumb defaults to soft, and iOS likes thumb, so by overriding with
-float-abi=softfp, I am avoiding the ldc -> IR -> llc -> obj 2-phase
approach and using ldc all the way to build phobos.

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

Assertion failed: ((TLI.getTypeAction(*DAG.getContext(), Node->getOperand(i).getValueType()) == TargetLowering::TypeLegal || Node->getOperand(i).getOpcode() == ISD::TargetConstant) && "Unexpected illegal type!"), function LegalizeOp, file /Users/dan/projects/ldc/llvm-svn/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 1165.

These fail in same way:
-mtriple=armv7-apple-darwin -float-abi=soft
-mtriple=armv7-unknown-linux-gnueabi -float-abi=soft
-mtriple=thumbv7-unknown-linux-gnueabi

It has something to do with TargetOptions UseSoftFloat = 1.

I can file an issue if you like.  Perhaps it is an llvm bug though.
-- 
Dan


More information about the digitalmars-d-ldc mailing list