This is an archive of the discontinued LLVM Phabricator instance.

[libc++abi] Apply simplify scan_eh_tab to SjLj
ClosedPublic

Authored by kaz7 on Aug 14 2021, 7:12 PM.

Details

Summary

Previous "simplify scan_eh_tab" patch, https://reviews.llvm.org/D93190,
saves landingpad if and only if the target is not using SjLj exceptions.
However, the landingpad is used by SjLj exception handler also. This
patch changes to set landingpad for both exception handlers.

Diff Detail

Event Timeline

kaz7 requested review of this revision.Aug 14 2021, 7:12 PM
kaz7 created this revision.
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 14 2021, 7:12 PM
MaskRay accepted this revision.Aug 14 2021, 8:21 PM

Thanks! Who is still using sjlj exceptions?

kaz7 added a comment.Aug 15 2021, 3:01 AM

VE is still using SjLj. :-)

Thanks! Who is still using sjlj exceptions?

MinGW toolchains can use sjlj; for x86 32 bit, sjlj is still the default in GCC (although many environments configure it to use dwarf instead of sjlj).

kaz7 added a comment.Aug 17 2021, 2:52 PM

@mstorsjo Is it possible to test this on mingw with SjLj?

I've tested this on VE with SjLj. This patch fixes problems in check-libcxxabi and check-libcxx caused by previous patch. I prefer few more tests.

@mstorsjo Is it possible to test this on mingw with SjLj?

I'm testing, but it seems like SjLj for mingw targets broke somewhere between 11.0.0 and 12.0.0 - currently trying to look into whether it is a code generation bug or a bug in libcxxabi/libunwind somewhere (and if it's a bug that is fixed by this patch).

mstorsjo accepted this revision.Aug 18 2021, 7:32 AM

I can confirm that this fixes sjlj unwinding in mingw configurations too, working just as well as it did in LLVM 11.0.0. Thanks!

(This would be a great thing to backport to the ongoing 13.x branch IMO.)

kaz7 added a comment.Aug 19 2021, 12:51 AM

@mstorsjo Thank you for your help.

May I get a LGTM from an owner? Thanks!

@ldionne I think you're needed to unblock this one?

@phosek @compnerd - Can either of you unblock and approve this patch for the libc++abi group?

ldionne accepted this revision.Aug 24 2021, 1:50 PM
ldionne added a subscriber: tstellar.

This fell under my radar -- I'm not as active on libc++abi as libc++.

I'll take what @mstorsjo said as a proof that this works and is solving some issues, but I'm personally not familiar with the code.

@tstellar This is fixing a real issue on MinGW, can I cherry-pick -x to release/13.x?

This revision is now accepted and ready to land.Aug 24 2021, 1:50 PM
This revision was automatically updated to reflect the committed changes.
kaz7 added a comment.Aug 25 2021, 6:35 AM

Thank you!

This fell under my radar -- I'm not as active on libc++abi as libc++.

I'll take what @mstorsjo said as a proof that this works and is solving some issues, but I'm personally not familiar with the code.

@tstellar This is fixing a real issue on MinGW, can I cherry-pick -x to release/13.x?

Sure, go for it.