diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-05-11 10:35:34 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-13 13:41:31 +0100 |
commit | f3c90e12b1d4c421946686e9e64fbc8eb9ca8131 (patch) | |
tree | eabafee07573950d6e5b19ba67ce1fba5a361167 | |
parent | af6bfedb0024f71976046a11de819bc803a578f6 (diff) | |
download | poky-f3c90e12b1d4c421946686e9e64fbc8eb9ca8131.tar.gz |
gdb,strace: Fix builds on ppc/musl
ptrace namespace is polluted in glibc for ppc
which is highlighted with musl, these fixes
tries to undo it
(From OE-Core rev: cc48929e916697d2103738cf12f02f47cdd43f32)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 files changed, 99 insertions, 8 deletions
diff --git a/meta/recipes-devtools/gdb/gdb.inc b/meta/recipes-devtools/gdb/gdb.inc index d9c864dcab..5a2067e04c 100644 --- a/meta/recipes-devtools/gdb/gdb.inc +++ b/meta/recipes-devtools/gdb/gdb.inc | |||
@@ -2,13 +2,15 @@ require gdb-common.inc | |||
2 | 2 | ||
3 | inherit gettext | 3 | inherit gettext |
4 | 4 | ||
5 | SRC_URI += "file://0002-Change-order-of-CFLAGS.patch \ | 5 | SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.gz \ |
6 | file://0003-Add-support-for-Renesas-SH-sh4-architecture.patch \ | 6 | file://0002-Change-order-of-CFLAGS.patch \ |
7 | file://0001-Use-exported-definitions-of-SIGRTMIN.patch \ | 7 | file://0003-Add-support-for-Renesas-SH-sh4-architecture.patch \ |
8 | file://0001-include-sys-types.h-for-mode_t.patch \ | 8 | file://0001-Use-exported-definitions-of-SIGRTMIN.patch \ |
9 | file://0001-use-asm-sgidefs.h.patch \ | 9 | file://0001-include-sys-types.h-for-mode_t.patch \ |
10 | file://force-readline-static.patch \ | 10 | file://0001-use-asm-sgidefs.h.patch \ |
11 | file://0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \ | 11 | file://force-readline-static.patch \ |
12 | file://0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \ | ||
13 | file://0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \ | ||
12 | " | 14 | " |
13 | #LDFLAGS_append = " -s" | 15 | #LDFLAGS_append = " -s" |
14 | #export CFLAGS_append=" -L${STAGING_LIBDIR}" | 16 | #export CFLAGS_append=" -L${STAGING_LIBDIR}" |
diff --git a/meta/recipes-devtools/gdb/gdb/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/meta/recipes-devtools/gdb/gdb/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch new file mode 100644 index 0000000000..342f1ce425 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 33a2cdb731298b73277507f01b9a21cd340c5b5c Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 30 Apr 2016 16:46:03 +0000 | ||
4 | Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | gdb/gdbserver/linux-ppc-low.c | 6 ++++++ | ||
11 | gdb/nat/ppc-linux.h | 6 ++++++ | ||
12 | 2 files changed, 12 insertions(+) | ||
13 | |||
14 | diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c | ||
15 | index 188fac0..f71d5ab 100644 | ||
16 | --- a/gdb/gdbserver/linux-ppc-low.c | ||
17 | +++ b/gdb/gdbserver/linux-ppc-low.c | ||
18 | @@ -21,7 +21,13 @@ | ||
19 | #include "linux-low.h" | ||
20 | |||
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 "nat/ppc-linux.h" | ||
31 | |||
32 | diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h | ||
33 | index 0ff2223..c978daa 100644 | ||
34 | --- a/gdb/nat/ppc-linux.h | ||
35 | +++ b/gdb/nat/ppc-linux.h | ||
36 | @@ -18,7 +18,13 @@ | ||
37 | #ifndef PPC_LINUX_H | ||
38 | #define PPC_LINUX_H 1 | ||
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. */ | ||
50 | -- | ||
51 | 1.8.3.1 | ||
52 | |||
diff --git a/meta/recipes-devtools/strace/strace/0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch b/meta/recipes-devtools/strace/strace/0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch new file mode 100644 index 0000000000..7f59210ca9 --- /dev/null +++ b/meta/recipes-devtools/strace/strace/0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 1f0c22b79045cfcdc976643f383c1d09589d3087 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 30 Apr 2016 16:23:56 +0000 | ||
4 | Subject: [PATCH] Fix build when using non-glibc libc implementation on ppc | ||
5 | |||
6 | glibc includes the kernel header into its own header for macros | ||
7 | musl does not | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | ptrace.h | 8 +++++++- | ||
13 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/ptrace.h b/ptrace.h | ||
16 | index d8af976..4978a69 100644 | ||
17 | --- a/ptrace.h | ||
18 | +++ b/ptrace.h | ||
19 | @@ -52,7 +52,13 @@ extern long ptrace(int, int, char *, long); | ||
20 | # define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args | ||
21 | #endif | ||
22 | |||
23 | -#include <linux/ptrace.h> | ||
24 | +#if defined(POWERPC) && !defined(__GLIBC__) | ||
25 | +#define pt_regs uapi_pt_regs | ||
26 | +#endif | ||
27 | +# include <linux/ptrace.h> | ||
28 | +#if defined(POWERPC) && !defined(__GLIBC__) | ||
29 | +# undef pt_regs | ||
30 | +#endif | ||
31 | |||
32 | #ifdef HAVE_STRUCT_IA64_FPREG | ||
33 | # undef ia64_fpreg | ||
34 | -- | ||
35 | 1.8.3.1 | ||
36 | |||
diff --git a/meta/recipes-devtools/strace/strace_4.11.bb b/meta/recipes-devtools/strace/strace_4.11.bb index 7391388020..56b64bb0c9 100644 --- a/meta/recipes-devtools/strace/strace_4.11.bb +++ b/meta/recipes-devtools/strace/strace_4.11.bb | |||
@@ -16,7 +16,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \ | |||
16 | file://0001-Move-gcc-compat-macros-to-gcc_compat.h.patch \ | 16 | file://0001-Move-gcc-compat-macros-to-gcc_compat.h.patch \ |
17 | file://0001-tests-introduce-libtests.patch \ | 17 | file://0001-tests-introduce-libtests.patch \ |
18 | file://run-ptest \ | 18 | file://run-ptest \ |
19 | " | 19 | file://0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch \ |
20 | " | ||
20 | 21 | ||
21 | SRC_URI[md5sum] = "a15d2555a7febb56d00c6e1a51c655dc" | 22 | SRC_URI[md5sum] = "a15d2555a7febb56d00c6e1a51c655dc" |
22 | SRC_URI[sha256sum] = "e86a5f6cd8f941f67f3e4b28f4e60f3d9185c951cf266404533210a2e5cd8152" | 23 | SRC_URI[sha256sum] = "e86a5f6cd8f941f67f3e4b28f4e60f3d9185c951cf266404533210a2e5cd8152" |