Android/ARM: fixing exception-handling

Joakim via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Wed Jun 17 00:32:34 PDT 2015


On Wednesday, 17 June 2015 at 06:50:52 UTC, Dan Olson wrote:
> There might be some clues in the iOS branch for ldc/eh.d even 
> though it is dealing with SjLj style exceptions and landing 
> pads are interpreted differently.  It has few version 
> variations but uses much of the same code.  It seems to work ok 
> during the unittests.  I haven't encountered any weirdness 
> since I spent some late nights with a debugger a year ago.
>
> https://github.com/smolt/druntime/blob/ios/src/ldc/eh.d
>
> Diff with tag v0.15.1 to see where I changed stuff.  All my 
> published ios branches are currently based on 0.15.1 and using 
> LLVM 3.5.1.
>
> Joakim, what branch of LDC are you basing your Android stuff on?

I'm currently using the merge-2.067 branch linked against a 
lightly patched llvm 3.6, the one that's used in the Android NDK, 
and compiled by clang 3.6.1.

> I can publish to github ios merges with 0.15.2-beta and 0.16.0 
> (branch merge-2.067), but I don't think there is any additional 
> help there with regard to EH, even though ldc/eh.d did change 
> for druntime ldc branch.

I hadn't bothered looking at how your iOS branch dealt with 
exceptions, since you had said a while back that it uses 
setjmp/longjmp exceptions, but I'll take a look now and see if 
there's anything helpful.

> As far as codegen problems - there is nothing related to EH 
> that I can think of.  The optimizer occassionally gets some 
> alignment wrong with neon instructions in LLVM 3.5.1, but that 
> does not show up as a EH problem.  Currently neon is disabled 
> when building optimized libs.
>
> If you haven't created a gen/abi-arm.{h,cpp}, you will need to 
> as the default has a few problems on ARM, but still not related 
> to EH.  If you are on LLVM 3.5.1, try the one on the ios branch 
> named abi-ios.{h,cpp}. There are additional abi-ios changes for 
> 0.15.2 because D variadic functions handling changed.

I'll take a look.  Right now, the only change I made to 
gen/abi.cpp is to use the C calling convention everywhere.


More information about the digitalmars-d-ldc mailing list