Skip to content

Commit a2c0ac0

Browse files
authored
[llvm-exegesis] Fix musl build (#147954)
We should not include both linux/prctl.h and sys/prctl.h. This works with glibc because the latter includes the former, but breaks with musl because the latter redeclares the contents of the former, resulting in: ``` /usr/local/aarch64-linux-musl/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map' 88 | struct prctl_mm_map { | ^~~~~~~~~~~~ In file included from /checkout/src/llvm-project/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp:13: /usr/local/aarch64-linux-musl/include/linux/prctl.h:134:8: note: previous definition of 'struct prctl_mm_map' 134 | struct prctl_mm_map { | ^~~~~~~~~~~~ ``` Fixes #139443.
1 parent 362d5ff commit a2c0ac0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include "AArch64RegisterInfo.h"
1111

1212
#if defined(__aarch64__) && defined(__linux__)
13-
#include <linux/prctl.h> // For PR_PAC_* constants
14-
#include <sys/prctl.h>
13+
#include <sys/prctl.h> // For PR_PAC_* constants
1514
#ifndef PR_PAC_APIAKEY
1615
#define PR_PAC_APIAKEY (1UL << 0)
1716
#endif

0 commit comments

Comments
 (0)