[libcxx-commits] [compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)
Daniil Kovalev via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Sep 22 09:59:11 PDT 2025
================
@@ -30,6 +30,51 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,
_Unwind_Personality_Fn);
#endif
+#if __has_feature(ptrauth_calls)
----------------
kovdan01 wrote:
As discussed previously, let's use the new macro `LIBUNWIND_PTRAUTH_CALLS_AND_RETURNS` defined as follows everywhere instead of `__has_include(<ptrauth.h>)`, `__has_feature(ptrauth_calls)`, `__has_feature(ptrauth_returns)`, `__has_extension(ptrauth_qualifier)`, etc:
```
#if __has_feature(ptrauth_calls) && __has_feature(ptrauth_returns)
#define LIBUNWIND_PTRAUTH_CALLS_AND_RETURNS
#elif __has_feature(ptrauth_calls) || __has_feature(ptrauth_returns)
#error "Either both or none of ptrauth_calls and ptrauth_returns is allowed to be enabled"
#endif
```
See proposed fix in commit 644405b56cfa59dd3787119182df087dff6e756c in my branch https://github.com/kovdan01/llvm-project/commits/pointer-authenticated-unwinding-2025-09-22-with-fixes/.
I think this should be done in scope of this PR.
https://github.com/llvm/llvm-project/pull/143230
More information about the libcxx-commits
mailing list