[compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 6 09:12:42 PDT 2025


================
@@ -43,6 +43,104 @@
   #define LIBUNWIND_AVAIL
 #endif
 
+#if __has_feature(ptrauth_calls)
+
+  #include <ptrauth.h>
+
+  #if __has_extension(ptrauth_restricted_intptr_qualifier)
----------------
kovdan01 wrote:

Let's add a comment explaining that we need that because of Apple's fork so people unaware of the problem would know why such checks are needed.

The comment might look like this:

```
// In Apple's fork of clang, `__ptrauth` qualifier can be only applied to
// pointer types, and `__ptrauth_restricted_intptr` is used instead for
// integer types. In mainline clang, we only have `__ptrauth` which could
// be applied both to pointer and integer types.
// These helper macros allow seemless build of runtime libraries with
// Apple's fork of clang.
// TODO: If/when Apple's clang switches to mainline way of using
// `__ptrauth` qualifier, get rid of these conditionals.
```

https://github.com/llvm/llvm-project/pull/143230


More information about the llvm-commits mailing list