Index: compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp +++ compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp @@ -121,6 +121,18 @@ #elif defined(__riscv) // frame[-1] contains the return address uhwptr pc1 = frame[-1]; +#elif defined(__aarch64__) + uhwptr pc1; + // On the stack the link register could be protected with Pointer + // Authentication Code. Strip the AUTH part unconditionally, xpaclri is in + // the NOP space so will do nothing when it is not enabled or not available. + asm volatile( + "mov x30, %1\n\t" + "xpaclri\n\t" + "mov %0, x30\n\t" + : "=r"(pc1) + : "r"(frame[1]) + : "x30"); #else uhwptr pc1 = frame[1]; #endif