summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gdb
diff options
context:
space:
mode:
authorPaul Barker <paul@betafive.co.uk>2019-05-08 11:58:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-09 16:31:56 +0100
commitb5dd016f29303513f94655a7fd0bb10931913434 (patch)
tree30486c59dc576d7b4f51f5c8ed2d711cdff74711 /meta/recipes-devtools/gdb
parent19204c8940ef5455f4d541a84eb609ebcc58dcb3 (diff)
downloadpoky-b5dd016f29303513f94655a7fd0bb10931913434.tar.gz
gdb: Fix aarch64 build with musl
(From OE-Core rev: f178990495c773b4b36b1be6aafc2da158b76894) Signed-off-by: Paul Barker <paul@betafive.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gdb')
-rw-r--r--meta/recipes-devtools/gdb/gdb-8.2.1.inc1
-rw-r--r--meta/recipes-devtools/gdb/gdb/0012-AArch64-Fix-the-gdb-build-with-musl-libc.patch52
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gdb/gdb-8.2.1.inc b/meta/recipes-devtools/gdb/gdb-8.2.1.inc
index cb8d189f2a..f28b57439c 100644
--- a/meta/recipes-devtools/gdb/gdb-8.2.1.inc
+++ b/meta/recipes-devtools/gdb/gdb-8.2.1.inc
@@ -18,6 +18,7 @@ SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \
18 file://gdbserver-ctrl-c-handling.patch \ 18 file://gdbserver-ctrl-c-handling.patch \
19 file://0001-Fix-build-with-latest-GCC-9.0-tree.patch \ 19 file://0001-Fix-build-with-latest-GCC-9.0-tree.patch \
20 file://CVE-2017-9778.patch \ 20 file://CVE-2017-9778.patch \
21 file://0012-AArch64-Fix-the-gdb-build-with-musl-libc.patch \
21" 22"
22SRC_URI[md5sum] = "f8b2562e830a4098dd5b5ea9e9296c70" 23SRC_URI[md5sum] = "f8b2562e830a4098dd5b5ea9e9296c70"
23SRC_URI[sha256sum] = "0a6a432907a03c5c8eaad3c3cffd50c00a40c3a5e3c4039440624bae703f2202" 24SRC_URI[sha256sum] = "0a6a432907a03c5c8eaad3c3cffd50c00a40c3a5e3c4039440624bae703f2202"
diff --git a/meta/recipes-devtools/gdb/gdb/0012-AArch64-Fix-the-gdb-build-with-musl-libc.patch b/meta/recipes-devtools/gdb/gdb/0012-AArch64-Fix-the-gdb-build-with-musl-libc.patch
new file mode 100644
index 0000000000..f35033c122
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/0012-AArch64-Fix-the-gdb-build-with-musl-libc.patch
@@ -0,0 +1,52 @@
1From cbbf1a8ba7f037ba3b83f090829edcbab542c285 Mon Sep 17 00:00:00 2001
2From: Szabolcs Nagy <szabolcs.nagy@arm.com>
3Date: Thu, 13 Dec 2018 17:47:17 +0000
4Subject: [PATCH] AArch64: Fix the gdb build with musl libc
5
6Including asm/sigcontext.h together with libc headers is not valid. In
7general linux headers may not work with libc headers, so mixing them
8should be avoided, especially when the linux header defines types that
9are also exposed in libc headers.
10
11In case of asm/sigcontext.h glibc happens to work because glibc signal.h
12directly includes it, but e.g. in musl libc signal.h replicates the
13sigcontext.h definitions in an abi compatible way which are in conflict
14with the linux definitions when both headers are included.
15
16Since old linux headers or old libc headers may not have the necessary
17definitions, gdb has to replicate the definitions it relies on anyway.
18Which is fine since all definitions must be ABI stable. For linux apis
19that are not available via libc headers, replicating the definitions in
20gdb is the most reliable way to use them.
21
22Note: asm/ptrace.h includes asm/sigcontext.h in some versions of linux
23headers, which is just as problematic and should be fixed in linux.
24
25gdb/ChangeLog:
26
27 * nat/aarch64-sve-linux-ptrace.h: Include signal.h instead of
28 asm/sigcontext.h.
29
30[ChangeLog entry stripped so that patch applies cleanly]
31Upstream-Status: Backport
32Signed-off-by: Paul Barker <paul@betafive.co.uk>
33---
34 gdb/nat/aarch64-sve-linux-ptrace.h | 2 +-
35 1 file changed, 1 insertion(+), 1 deletion(-)
36
37diff --git a/gdb/nat/aarch64-sve-linux-ptrace.h b/gdb/nat/aarch64-sve-linux-ptrace.h
38index 029e753ffe..172ae39432 100644
39--- a/gdb/nat/aarch64-sve-linux-ptrace.h
40+++ b/gdb/nat/aarch64-sve-linux-ptrace.h
41@@ -20,7 +20,7 @@
42 #ifndef AARCH64_SVE_LINUX_PTRACE_H
43 #define AARCH64_SVE_LINUX_PTRACE_H
44
45-#include <asm/sigcontext.h>
46+#include <signal.h>
47 #include <sys/utsname.h>
48 #include <sys/ptrace.h>
49 #include <asm/ptrace.h>
50--
512.17.1
52