summaryrefslogtreecommitdiffstats
path: root/libs/gperftools/patches/0001-powerpc-include-asm-ptrace.h-for-PT_NIP-declaration.patch
blob: 7fec83ac473e13eea3ab6e836be052ae93da8a64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Josef Schlehofer <pepe.schlehofer@gmail.com>
Date: Tue, 23 Sep 2025 18:35:30 +0200
Subject: [PATCH] powerpc: include <asm/ptrace.h> for PT_NIP declaration

This patch conditionally includes <asm/ptrace.h> when available to
ensure PT_NIP is properly declared, fixing build failures such as:

  error: 'PT_NIP' was not declared in this scope; did you mean 'PT_NUM'?

It happened on musl and powerpc
---
 src/stacktrace_powerpc-linux-inl.h | 3 +++
 1 file changed, 3 insertions(+)

--- a/src/stacktrace_powerpc-linux-inl.h
+++ b/src/stacktrace_powerpc-linux-inl.h
@@ -48,6 +48,9 @@
 #include <gperftools/stacktrace.h>
 #include <base/vdso_support.h>
 
+#ifdef HAVE_ASM_PTRACE_H
+#include <asm/ptrace.h>
+#endif
 #if HAVE_SYS_UCONTEXT_H
 #include <sys/ucontext.h>
 #elif HAVE_UCONTEXT_H