[cfe-dev] How to use SJLJ exceptions with clang ?
Bill Wendling
isanbard at gmail.com
Thu Oct 17 16:23:31 PDT 2013
On Oct 16, 2013, at 10:31 AM, Nicola Gigante <nicola.gigante at gmail.com> wrote:
> Il giorno 15/ott/2013, alle ore 21:40, Bob Wilson <bob.wilson at apple.com> ha scritto:
>
>>
>> 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.
>
> I don't want to criticize Apple's design decisions, especially since this is an
> issue from the old "hack on GCC" days, and I know that to
> most of those questions you can't answer anyway, but: why don't let, say,
> iOS 4-targeted binaries use the new ABI and stick legacy code on a different segment
> on fat/universal binaries, and let Xcode do the linking magic? In the round of one
> or maybe two years, nobody links to older SDKs anymore anyway. This question
> of course applies to any iOS "new feature breaks ABI" issue...
>
For every such decision (in any organization), you must consider the costs and benefits. I suspect that the cost of switching over the ARM platform to DWARF EH wasn't worth the effort (which would have been large). And as Bob said, the SjLj EH is smaller, which is important to mobile devices.
-bw
More information about the cfe-dev
mailing list