[PATCH] D126863: [compiler-rt] Check __SEH__, when checking if ARM EHABI is implied

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 02:33:53 PDT 2022


mstorsjo created this revision.
mstorsjo added reviewers: MaskRay, efriedma, zzheng.
Herald added subscribers: Enna1, StephenFan, kristof.beyls, dberris.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

ARM EHABI isn't signalled by any specific compiler builtin define,
but is implied by the lack of defines specifying any other
exception handling mechanism, `__USING_SJLJ_EXCEPTIONS__` or
`__ARM_DWARF_EH__`.

As Windows SEH also can be used for unwinding, check for the
`__SEH__` define too, in the same way.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126863

Files:
  compiler-rt/lib/builtins/gcc_personality_v0.c


Index: compiler-rt/lib/builtins/gcc_personality_v0.c
===================================================================
--- compiler-rt/lib/builtins/gcc_personality_v0.c
+++ compiler-rt/lib/builtins/gcc_personality_v0.c
@@ -143,7 +143,7 @@
 }
 
 #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) &&                 \
-    !defined(__ARM_DWARF_EH__)
+    !defined(__ARM_DWARF_EH__) && !defined(__SEH__)
 #define USING_ARM_EHABI 1
 _Unwind_Reason_Code __gnu_unwind_frame(struct _Unwind_Exception *,
                                        struct _Unwind_Context *);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126863.433696.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220602/f1c6b86b/attachment.bin>


More information about the llvm-commits mailing list