[cfe-dev] How to use SJLJ exceptions with clang ?

Bob Wilson bob.wilson at apple.com
Tue Oct 15 12:40:52 PDT 2013


On Oct 14, 2013, at 8:52 PM, Andrew Trick <atrick at apple.com> wrote:

> 
> On Oct 11, 2013, at 2:29 PM, Bill Wendling <isanbard at gmail.com> wrote:
> 
>> On Oct 10, 2013, at 11:30 PM, Nicola Gigante <nicola.gigante at gmail.com> wrote:
>> 
>>> Il giorno 11/ott/2013, alle ore 00:58, Anton Korobeynikov <anton at korobeynikov.info> ha scritto:
>>>> 
>>>> sjlj exceptions are only used on arm/darwin. So, no, you cannot enable
>>>> them via some flag.
>>> 
>>> Does it mean that iOS code uses sjlj exceptions?
>> 
>> That's correct.
>> 
>>> That seems weird and unexpected at a first glance! (at least for someone without ARM insights) Sorry for my ignorance: why are zero cost exceptions not possible on arm?
>> 
>> I don't know. I can only hazard guesses. :-/
> 
> SjLj is the most space efficient. I am not promoting it though.

At the time iOS was first developed, SjLj was the only exception handling mechanism supported by GCC for ARM.  I think DWARF unwinding support for ARM may have been added to GCC right around the same time but it didn't arrive quite in time to be adopted for iOS.  Changing it after the first release would have been a major ABI break, so we've been stuck with SjLj.  Note that the new 64-bit iOS ABI does _not_ use SjLj.



More information about the cfe-dev mailing list