[PATCH 2/3] Fixes incorrect #ifs for SJ/LJ exceptions

The was working because, given __APPLE__, _LIBUNWIND_BUILD_SJLJ_APIS was set to
__arm__, but other ARM targets not using SJ/LJ will fail to compile.

Dan,

I think that it would be a good idea to keep libc++abi from depending on this particular unwinder, because not all targets are going to use it, and they really are two separate components. Also, I've read rumors that folks want to move said unwinder over to the compiler-rt repository...

Therefore the guards in cxa_exception.cpp and cxa_personality.cpp should be using __USING_SJLJ_EXCEPTIONS__ instead (which is defined by the compiler when setjmp-longjmp exceptions are being used). In unwind.h, to me it still makes sense to use _LIBUNWIND_BUILD_SJLJ_APIS, but its definition needs to be pulled in from config.h.

Jon

Sorry for the delay. I’ve attached a revised patch.

I opted to switch unwind.h to the more generic definition as well since that seems cleaner. Let me know if there’s a good reason to do otherwise.

  • Dan

0001-Fixes-incorrect-ifs-for-SJ-LJ-exceptions.patch (2.64 KB)

LGTM

Jon