diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-06-03 22:41:22 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-06-11 18:00:48 +0200 |
commit | 1bad51784646bce34a177199aaf7689c689bb816 (patch) | |
tree | 042e19b2e7bf09b365cebd6c8eab2a05e1e52792 /package/gdb/7.10.1 | |
parent | 61b502794eda3fdd100eea9e8f3d0b78f8fe4151 (diff) | |
download | buildroot-1bad51784646bce34a177199aaf7689c689bb816.tar.gz buildroot-1bad51784646bce34a177199aaf7689c689bb816.zip |
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
Diffstat (limited to 'package/gdb/7.10.1')
-rw-r--r-- | package/gdb/7.10.1/0008-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | 53 | ||||
-rw-r--r-- | package/gdb/7.10.1/0009-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch | 41 |
2 files changed, 94 insertions, 0 deletions
diff --git a/package/gdb/7.10.1/0008-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/7.10.1/0008-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch new file mode 100644 index 0000000000..c280831abc --- /dev/null +++ b/package/gdb/7.10.1/0008-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch @@ -0,0 +1,53 @@ +From 3964e15443c5cdfca6723987c8ef1ef6cf984d41 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> +--- + gdb/gdbserver/linux-ppc-low.c | 6 ++++++ + gdb/nat/ppc-linux.h | 6 ++++++ + 2 files changed, 12 insertions(+) + +diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c +index 188fac0..f71d5ab 100644 +--- a/gdb/gdbserver/linux-ppc-low.c ++++ b/gdb/gdbserver/linux-ppc-low.c +@@ -21,7 +21,13 @@ + #include "linux-low.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 "nat/ppc-linux.h" + +diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h +index 0ff2223..c978daa 100644 +--- a/gdb/nat/ppc-linux.h ++++ b/gdb/nat/ppc-linux.h +@@ -18,7 +18,13 @@ + #ifndef PPC_LINUX_H + #define PPC_LINUX_H 1 + ++#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. */ +-- +2.7.4 + diff --git a/package/gdb/7.10.1/0009-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/7.10.1/0009-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch new file mode 100644 index 0000000000..50f9512bbc --- /dev/null +++ b/package/gdb/7.10.1/0009-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch @@ -0,0 +1,41 @@ +From 1662a42e980c3f605000b23fda86ab24ceb69d32 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 218d4d3..c4ada84 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 + |