diff options
author | Khem Raj <raj.khem@gmail.com> | 2018-12-26 12:09:51 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-27 22:52:58 +0000 |
commit | 51045ffb264ad99820e7c5539a41c43a37571291 (patch) | |
tree | 555c8eb7c7b842bac25d0f968f8738b7d4f1e3fa | |
parent | 1ef07c387ff1a5497151e453f2ca47c75d5135b2 (diff) | |
download | poky-51045ffb264ad99820e7c5539a41c43a37571291.tar.gz |
gdb: Backport a fix to build with gcc9
(From OE-Core rev: 389d956bdacee92125c0112a58991516b866a39b)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/gdb/gdb-8.2.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/gdb/gdb/0001-Fix-build-with-latest-GCC-9.0-tree.patch | 50 |
2 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gdb/gdb-8.2.inc b/meta/recipes-devtools/gdb/gdb-8.2.inc index 7e0809de72..f6d75ed081 100644 --- a/meta/recipes-devtools/gdb/gdb-8.2.inc +++ b/meta/recipes-devtools/gdb/gdb-8.2.inc | |||
@@ -16,6 +16,7 @@ SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \ | |||
16 | file://0010-resolve-restrict-keyword-conflict.patch \ | 16 | file://0010-resolve-restrict-keyword-conflict.patch \ |
17 | file://0011-Fix-invalid-sigprocmask-call.patch \ | 17 | file://0011-Fix-invalid-sigprocmask-call.patch \ |
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 | " | 20 | " |
20 | SRC_URI[md5sum] = "b5a49dbff00d9a87fbe114d14b3101c0" | 21 | SRC_URI[md5sum] = "b5a49dbff00d9a87fbe114d14b3101c0" |
21 | SRC_URI[sha256sum] = "c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39" | 22 | SRC_URI[sha256sum] = "c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39" |
diff --git a/meta/recipes-devtools/gdb/gdb/0001-Fix-build-with-latest-GCC-9.0-tree.patch b/meta/recipes-devtools/gdb/gdb/0001-Fix-build-with-latest-GCC-9.0-tree.patch new file mode 100644 index 0000000000..2a962929d7 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/0001-Fix-build-with-latest-GCC-9.0-tree.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 7406a50077773e78282a495cb32ef5b8179f6a33 Mon Sep 17 00:00:00 2001 | ||
2 | From: Dimitar Dimitrov <dimitar@dinux.eu> | ||
3 | Date: Mon, 17 Dec 2018 21:30:52 +0200 | ||
4 | Subject: [PATCH] Fix build with latest GCC 9.0 tree | ||
5 | |||
6 | A recent patch [1] to fix a GCC PR [2] actually broke the GDB build. | ||
7 | To fix, remove the stack pointer clobber. GCC will ignore the clobber | ||
8 | marker, and will not save or restore the stack pointer. | ||
9 | |||
10 | I ran "make check-gdb" on x86_64 to ensure there are no regressions. | ||
11 | |||
12 | gdb/ChangeLog: | ||
13 | |||
14 | 2018-12-17 Dimitar Dimitrov <dimitar@dinux.eu> | ||
15 | |||
16 | * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Remove sp clobbers. | ||
17 | |||
18 | [1] https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00532.html | ||
19 | [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813 | ||
20 | |||
21 | Upstream-Status: Backport | ||
22 | Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu> | ||
23 | --- | ||
24 | gdb/ChangeLog | 5 +++++ | ||
25 | gdb/nat/linux-ptrace.c | 4 ++-- | ||
26 | 2 files changed, 7 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c | ||
29 | index d4c1b8f9fd..187cfeb9bc 100644 | ||
30 | --- a/gdb/nat/linux-ptrace.c | ||
31 | +++ b/gdb/nat/linux-ptrace.c | ||
32 | @@ -161,14 +161,14 @@ linux_ptrace_test_ret_to_nx (void) | ||
33 | ".globl linux_ptrace_test_ret_to_nx_instr;" | ||
34 | "linux_ptrace_test_ret_to_nx_instr:" | ||
35 | "ret" | ||
36 | - : : "r" (return_address) : "%esp", "memory"); | ||
37 | + : : "r" (return_address) : "memory"); | ||
38 | #elif defined __x86_64__ | ||
39 | asm volatile ("pushq %0;" | ||
40 | ".globl linux_ptrace_test_ret_to_nx_instr;" | ||
41 | "linux_ptrace_test_ret_to_nx_instr:" | ||
42 | "ret" | ||
43 | : : "r" ((uint64_t) (uintptr_t) return_address) | ||
44 | - : "%rsp", "memory"); | ||
45 | + : "memory"); | ||
46 | #else | ||
47 | # error "!__i386__ && !__x86_64__" | ||
48 | #endif | ||
49 | -- | ||
50 | 2.20.1 | ||