[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
Wed Sep 3 05:16:15 PDT 2025


================
@@ -377,13 +391,31 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,
       case 'z':
         cieInfo->fdesHaveAugmentationData = true;
         break;
-      case 'P':
+      case 'P': {
         cieInfo->personalityEncoding = addressSpace.get8(p);
         ++p;
         cieInfo->personalityOffsetInCIE = (uint8_t)(p - cie);
-        cieInfo->personality = addressSpace
-            .getEncodedP(p, cieContentEnd, cieInfo->personalityEncoding);
+        pint_t personality = addressSpace.getEncodedP(
+            p, cieContentEnd, cieInfo->personalityEncoding,
+            /*datarelBase=*/0, &resultAddr);
+#if __libunwind_has_ptrauth
----------------
kovdan01 wrote:

I might be missing smth, but it looks like that we want to have a check against smth like `defined(__arm64e__) || __has_feature(ptrauth_calls)` here. Checking `__libunwind_has_ptrauth` just ensures that we have ptrauth.h header and corresponding intrinsics, but nothing else.

For arm64e, you have a fixed set of ptrauth features and you can be sure that having ptrauth_intrinsics implies also having ptrauth_calls. But this is not necessarily true for non-arm64e.

When we are talking about signed personality function pointer, on Linux it depends on ptrauth_calls feature: see #119361. So, we need to ensure this feature is present.

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


More information about the libcxx-commits mailing list