blob: c4bab7bb1a47db1d2d3bbc9fa65cc29118a6739e [file] [log] [blame]
Brad Bishopf6355e42020-12-08 14:30:50 -05001From d5817bcf2f7313699bfa85b41220d862db327664 Mon Sep 17 00:00:00 2001
Andrew Geissler82c905d2020-04-13 13:39:40 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 30 Apr 2016 18:32:14 -0700
Brad Bishopf6355e42020-12-08 14:30:50 -05004Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems
Andrew Geissler82c905d2020-04-13 13:39:40 -05005
6Upstream-Status: Pending
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
Brad Bishopf6355e42020-12-08 14:30:50 -050010 gdb/gdbserver/linux-ppc-low.c | 6 ++++++
11 gdb/nat/ppc-linux.h | 6 ++++++
Andrew Geissler82c905d2020-04-13 13:39:40 -050012 2 files changed, 12 insertions(+)
13
Brad Bishopf6355e42020-12-08 14:30:50 -050014diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
15index 5d8d67bec2..ffcf65ab58 100644
16--- a/gdb/gdbserver/linux-ppc-low.c
17+++ b/gdb/gdbserver/linux-ppc-low.c
18@@ -23,7 +23,13 @@
19 #include "elf/common.h"
20 #include <sys/uio.h>
21 #include <elf.h>
22+#if !defined(__GLIBC__)
23+# define pt_regs uapi_pt_regs
24+#endif
25 #include <asm/ptrace.h>
26+#if !defined(__GLIBC__)
27+# undef pt_regs
28+#endif
29
30 #include "arch/ppc-linux-common.h"
31 #include "arch/ppc-linux-tdesc.h"
Andrew Geissler82c905d2020-04-13 13:39:40 -050032diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
Brad Bishopf6355e42020-12-08 14:30:50 -050033index d937a65b69..1fd54b4a0e 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050034--- a/gdb/nat/ppc-linux.h
35+++ b/gdb/nat/ppc-linux.h
36@@ -18,7 +18,13 @@
37 #ifndef NAT_PPC_LINUX_H
38 #define NAT_PPC_LINUX_H
39
40+#if !defined(__GLIBC__)
41+# define pt_regs uapi_pt_regs
42+#endif
43 #include <asm/ptrace.h>
44+#if !defined(__GLIBC__)
45+# undef pt_regs
46+#endif
47 #include <asm/cputable.h>
48
49 /* This sometimes isn't defined. */