Skip to content

Commit 8f348bd

Browse files
committed
[llvm-exegesis][AArch64] Update PAC key handling for Linux
To resolve build failure due to undefined PR_PAC_SET_ENABLED_KEYS. 1) Added stricter check for OS requirement. 2) Initialized variable used if still undefined.
1 parent 15331c6 commit 8f348bd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
#include "AArch64.h"
1010
#include "AArch64RegisterInfo.h"
1111

12-
#ifdef __linux__
12+
#if defined(__aarch64__) && defined(__linux__)
1313
#include <linux/prctl.h> // For PR_PAC_* constants
1414
#include <sys/prctl.h>
15+
#ifndef PR_PAC_SET_ENABLED_KEYS
16+
#define PR_PAC_SET_ENABLED_KEYS 60
17+
#endif
1518
#endif
1619

1720
#define GET_AVAILABLE_OPCODE_CHECKER
@@ -188,7 +191,7 @@ class ExegesisAArch64Target : public ExegesisTarget {
188191
return Reason;
189192

190193
if (isPointerAuth(Opcode)) {
191-
#ifdef __linux__
194+
#if defined(__aarch64__) && defined(__linux__)
192195
// Disable all PAC keys. Note that while we expect the measurements to
193196
// be the same with PAC keys disabled, they could potentially be lower
194197
// since authentication checks are bypassed.

0 commit comments

Comments
 (0)