How to use SJLJ exceptions with clang ?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use SJLJ exceptions with clang ?

Yaron Keren
There support for SJLJ is in the sources but I can't get clang to recognize any flag to make it actually use these exceptions.

Yaron

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to use SJLJ exceptions with clang ?

Anton Korobeynikov
sjlj exceptions are only used on arm/darwin. So, no, you cannot enable
them via some flag.

On Thu, Oct 10, 2013 at 10:10 PM, Yaron Keren <[hidden email]> wrote:

> There support for SJLJ is in the sources but I can't get clang to recognize
> any flag to make it actually use these exceptions.
>
> Yaron
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to use SJLJ exceptions with clang ?

Nicola Gigante


> Il giorno 11/ott/2013, alle ore 00:58, Anton Korobeynikov <[hidden email]> 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 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?

Bye,
Nicola
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to use SJLJ exceptions with clang ?

Bill Wendling-3
On Oct 10, 2013, at 11:30 PM, Nicola Gigante <[hidden email]> wrote:

> Il giorno 11/ott/2013, alle ore 00:58, Anton Korobeynikov <[hidden email]> 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. :-/

-bw


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to use SJLJ exceptions with clang ?

Andrew Trick

On Oct 11, 2013, at 2:29 PM, Bill Wendling <[hidden email]> wrote:

> On Oct 10, 2013, at 11:30 PM, Nicola Gigante <[hidden email]> wrote:
>
>> Il giorno 11/ott/2013, alle ore 00:58, Anton Korobeynikov <[hidden email]> 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.
-Andy
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to use SJLJ exceptions with clang ?

Bill Wendling-3
On Oct 14, 2013, at 8:52 PM, Andrew Trick <[hidden email]> wrote:

> On Oct 11, 2013, at 2:29 PM, Bill Wendling <[hidden email]> wrote:
>
>> On Oct 10, 2013, at 11:30 PM, Nicola Gigante <[hidden email]> wrote:
>>
>>> Il giorno 11/ott/2013, alle ore 00:58, Anton Korobeynikov <[hidden email]> 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.

And the slowest. :-)

-bw



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to use SJLJ exceptions with clang ?

Bob Wilson
In reply to this post by Andrew Trick

On Oct 14, 2013, at 8:52 PM, Andrew Trick <[hidden email]> wrote:

>
> On Oct 11, 2013, at 2:29 PM, Bill Wendling <[hidden email]> wrote:
>
>> On Oct 10, 2013, at 11:30 PM, Nicola Gigante <[hidden email]> wrote:
>>
>>> Il giorno 11/ott/2013, alle ore 00:58, Anton Korobeynikov <[hidden email]> 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.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to use SJLJ exceptions with clang ?

Nicola Gigante

Il giorno 15/ott/2013, alle ore 21:40, Bob Wilson <[hidden email]> 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...

Bye,
Nicola

P.S. Sorry if this question is OT on this list, being iOS specific, but it comes natural
from previous discussions.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to use SJLJ exceptions with clang ?

Bill Wendling-3
On Oct 16, 2013, at 10:31 AM, Nicola Gigante <[hidden email]> wrote:

> Il giorno 15/ott/2013, alle ore 21:40, Bob Wilson <[hidden email]> 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


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev