kumquat-buildroot/package/gdb/8.3.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
James Hilliard d1737fc1b6 package/gdb: bump to version 8.3.1
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-04-02 21:45:53 +02:00

44 lines
1.2 KiB
Diff

From ef630288fdc2d4d22651702672f9d5c9cd767e5b Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sat, 3 Jun 2017 21:23:52 +0200
Subject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC
systems
Fixes a pt_{dsp,}regs redefinition when building with the musl C library
on SuperH.
Inspired by
http://git.yoctoproject.org/clean/cgit.cgi/poky/plain/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch,
adapted for SuperH.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Rebase on gdb 8.0]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/gdbserver/linux-sh-low.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
index 0953721a190..c331c1382f7 100644
--- a/gdb/gdbserver/linux-sh-low.c
+++ b/gdb/gdbserver/linux-sh-low.c
@@ -27,7 +27,15 @@ extern const struct target_desc *tdesc_sh;
#include <sys/reg.h>
#endif
+#if !defined(__GLIBC__)
+# define pt_regs uapi_pt_regs
+# define pt_dspregs uapi_pt_dspregs
+#endif
#include <asm/ptrace.h>
+#if !defined(__GLIBC__)
+# undef pt_regs
+# undef pt_dspregs
+#endif
#define sh_num_regs 41
--
2.21.0