From 7fbcc55c3b2dac91dcb0a8dc6daa5514ff323185 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 6 Aug 2016 17:32:50 -0700
Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems

Upstream-Status: Pending

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Rebase on gdb 8.3]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 gdb/nat/ppc-linux.h        | 6 ++++++
 gdbserver/linux-ppc-low.cc | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
index 3efc1b9a9bf..635d07486de 100644
--- a/gdb/nat/ppc-linux.h
+++ b/gdb/nat/ppc-linux.h
@@ -18,7 +18,13 @@
 #ifndef GDB_NAT_PPC_LINUX_H
 #define GDB_NAT_PPC_LINUX_H
 
+#if !defined(__GLIBC__)
+# define pt_regs uapi_pt_regs
+#endif
 #include <asm/ptrace.h>
+#if !defined(__GLIBC__)
+# undef pt_regs
+#endif
 #include <asm/cputable.h>
 
 /* This sometimes isn't defined.  */
diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc
index 3ce978f4c7c..38534297cdf 100644
--- a/gdbserver/linux-ppc-low.cc
+++ b/gdbserver/linux-ppc-low.cc
@@ -22,7 +22,13 @@
 #include "elf/common.h"
 #include <sys/uio.h>
 #include <elf.h>
+#if !defined(__GLIBC__)
+# define pt_regs uapi_pt_regs
+#endif
 #include <asm/ptrace.h>
+#if !defined(__GLIBC__)
+# undef pt_regs
+#endif
 
 #include "arch/ppc-linux-common.h"
 #include "arch/ppc-linux-tdesc.h"
-- 
2.48.1

