iphone + LDC, a new ARM adventure

Dan Olson zans.is.for.cans at yahoo.com
Wed Jan 8 09:39:19 PST 2014

Dan Olson <zans.is.for.cans at yahoo.com> writes:

> I'll spend some more time over the next few days and see what clang
> does to make the sjlj pass happy.
> Thanks for all the help so far,

I looked at what clang does different on i686-apple-darwin and
arm-apple-darwin and one thing that changed when targeting ios is a
bitcast on the personality function.  So I edited the results of ldc2

  %landing_pad = landingpad { i8*, i32 } personality i32 (i32, i32, i64, i8*, i8*)* @_d_eh_personality

  %landing_pad = landingpad { i8*, i32 } personality i8* bitcast (i32 (i32, i32, i64, i8*, i8*)* @_d_eh_personality to i8*)

Then ran llc on the modified file.  No assertion and I get arm assemble
code!  And it looks reasonable to my untrained eye.

By the way, llc is very cool.  As I said, I am totally new to llvm
internals, so am having fun learning what it has in its magic bag of

So far I cannot find where clang adds the bitcast thing for sjlj eh
personality.  I will keep hunting.  Any ideas where I would do this in

When it comes to updating the _d_eh_personality for sjlj, I noticed a
very small difference in the c++ versions ( _gxx_personality_v0 and
_gxx_personality_sj0).  It is actually one funtion body in


with a little extra code in an ifdef _GLIBCXX_SJLJ_EXCEPTIONS


More information about the digitalmars-d-ldc mailing list