kumquat-buildroot/package/gdb/7.12.1/0003-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
Thomas Petazzoni 1bad517846 gdb: add patches to fix musl build on ppc(64)(le) and sh
This commit small patches to gdb that fix redefined structures build
problems that occur when building on PowerPC, PowerPC64, PowerPC64le and
SuperH with the musl C library.

The PowerPC(64)(le) patch was taken from the Yocto Project, the SuperH
patch was inspired from the PowerPC patch. The issue has also been
reported upstream to the musl developers:

  http://www.openwall.com/lists/musl/2017/06/03/1

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes since v2:
 - None
Changes since v1:
 - None
2017-06-11 18:00:48 +02:00

42 lines
1.1 KiB
Diff

From 00a0ba059f01784e8da5cec3439ea2d6c4a2ef40 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>
---
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 ac084c9..08e104a 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.7.4