diff options
author | André Draszik <adraszik@tycoint.com> | 2017-06-19 12:49:38 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-28 15:52:18 +0100 |
commit | c1474a25a6fb27a32a405a136972dfd83c9806c1 (patch) | |
tree | 06e7ba41f2a2743b79e6b0b12fee9596c3d48c37 | |
parent | f1cf60006b8a798b30d5fcbbe6aaf3b713c40d59 (diff) | |
download | poky-c1474a25a6fb27a32a405a136972dfd83c9806c1.tar.gz |
gdb: fix gdbserver not working in musl/mips context
Similar to
https://bugs.lede-project.org/index.php?do=details&task_id=637&openedfrom=-1%2Bweek
(From OE-Core rev: 0b9d94a5e54191f93659f7b4e7a3cb4376487823)
Signed-off-by: André Draszik <adraszik@tycoint.com>
Acked-by: Sylvain Lemieux <slemieux@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/gdb/gdb-8.0.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch | 45 |
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gdb/gdb-8.0.inc b/meta/recipes-devtools/gdb/gdb-8.0.inc index 91f2ebfa4b..fba32ce12c 100644 --- a/meta/recipes-devtools/gdb/gdb-8.0.inc +++ b/meta/recipes-devtools/gdb/gdb-8.0.inc | |||
@@ -15,6 +15,7 @@ SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \ | |||
15 | file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \ | 15 | file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \ |
16 | file://0009-Change-order-of-CFLAGS.patch \ | 16 | file://0009-Change-order-of-CFLAGS.patch \ |
17 | file://0010-resolve-restrict-keyword-conflict.patch \ | 17 | file://0010-resolve-restrict-keyword-conflict.patch \ |
18 | file://package_devel_gdb_patches_120-sigprocmask-invalid-call.patch \ | ||
18 | " | 19 | " |
19 | SRC_URI[md5sum] = "c3d35cd949084be53b92cc1e03485f88" | 20 | SRC_URI[md5sum] = "c3d35cd949084be53b92cc1e03485f88" |
20 | SRC_URI[sha256sum] = "f6a24ffe4917e67014ef9273eb8b547cb96a13e5ca74895b06d683b391f3f4ee" | 21 | SRC_URI[sha256sum] = "f6a24ffe4917e67014ef9273eb8b547cb96a13e5ca74895b06d683b391f3f4ee" |
diff --git a/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch b/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch new file mode 100644 index 0000000000..c5484f789d --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001 | ||
2 | From: Yousong Zhou <yszhou4tech@gmail.com> | ||
3 | Date: Fri, 24 Mar 2017 10:36:03 +0800 | ||
4 | Subject: [PATCH] Fix invalid sigprocmask call | ||
5 | |||
6 | The POSIX document says | ||
7 | |||
8 | The pthread_sigmask() and sigprocmask() functions shall fail if: | ||
9 | |||
10 | [EINVAL] | ||
11 | The value of the how argument is not equal to one of the defined values. | ||
12 | |||
13 | and this is how musl-libc is currently doing. Fix the call to be safe | ||
14 | and correct | ||
15 | |||
16 | [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html | ||
17 | |||
18 | gdb/ChangeLog: | ||
19 | 2017-03-24 Yousong Zhou <yszhou4tech@gmail.com> | ||
20 | |||
21 | * common/signals-state-save-restore.c (save_original_signals_state): | ||
22 | Fix invalid sigprocmask call. | ||
23 | --- | ||
24 | Upstream-Status: Pending [not author, cherry-picked from LEDE https://bugs.lede-project.org/index.php?do=details&task_id=637&openedfrom=-1%2Bweek] | ||
25 | Signed-off-by: André Draszik <adraszik@tycoint.com> | ||
26 | gdb/ChangeLog | 5 +++++ | ||
27 | gdb/common/signals-state-save-restore.c | 2 +- | ||
28 | 2 files changed, 6 insertions(+), 1 deletion(-) | ||
29 | |||
30 | diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c | ||
31 | index d11a9ae..734335c 100644 | ||
32 | --- a/gdb/common/signals-state-save-restore.c | ||
33 | +++ b/gdb/common/signals-state-save-restore.c | ||
34 | @@ -41,7 +41,7 @@ save_original_signals_state (void) | ||
35 | int i; | ||
36 | int res; | ||
37 | |||
38 | - res = sigprocmask (0, NULL, &original_signal_mask); | ||
39 | + res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask); | ||
40 | if (res == -1) | ||
41 | perror_with_name (("sigprocmask")); | ||
42 | |||
43 | -- | ||
44 | 2.6.4 | ||
45 | |||