aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Draszik <adraszik@tycoint.com>2017-10-06 13:12:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-05 22:39:20 +0000
commitc33426e2011054043c276c72b8af651a9aa179ad (patch)
tree824e489950ebef43a0abd26f059a50c42f8ced64
parent265db40c75b6a4b9a666e49dd1739423eb711695 (diff)
downloadopenembedded-core-c33426e2011054043c276c72b8af651a9aa179ad.zip
openembedded-core-c33426e2011054043c276c72b8af651a9aa179ad.tar.gz
openembedded-core-c33426e2011054043c276c72b8af651a9aa179ad.tar.bz2
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 Signed-off-by: André Draszik <adraszik@tycoint.com> Acked-by: Sylvain Lemieux <slemieux@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit 0b9d94a5e54191f93659f7b4e7a3cb4376487823) Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/recipes-devtools/gdb/gdb-7.12.1.inc1
-rw-r--r--meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch45
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gdb/gdb-7.12.1.inc b/meta/recipes-devtools/gdb/gdb-7.12.1.inc
index b15a2b5..634756c 100644
--- a/meta/recipes-devtools/gdb/gdb-7.12.1.inc
+++ b/meta/recipes-devtools/gdb/gdb-7.12.1.inc
@@ -15,6 +15,7 @@ SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \
file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \
file://0009-Change-order-of-CFLAGS.patch \
file://0010-resolve-restrict-keyword-conflict.patch \
+ file://package_devel_gdb_patches_120-sigprocmask-invalid-call.patch \
"
SRC_URI[md5sum] = "193453347ddced7acb6b1cd2ee8f2e4b"
SRC_URI[sha256sum] = "4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186"
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 0000000..c5484f7
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch
@@ -0,0 +1,45 @@
+From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Fri, 24 Mar 2017 10:36:03 +0800
+Subject: [PATCH] Fix invalid sigprocmask call
+
+The POSIX document says
+
+ The pthread_sigmask() and sigprocmask() functions shall fail if:
+
+ [EINVAL]
+ The value of the how argument is not equal to one of the defined values.
+
+and this is how musl-libc is currently doing. Fix the call to be safe
+and correct
+
+ [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html
+
+gdb/ChangeLog:
+2017-03-24 Yousong Zhou <yszhou4tech@gmail.com>
+
+ * common/signals-state-save-restore.c (save_original_signals_state):
+ Fix invalid sigprocmask call.
+---
+Upstream-Status: Pending [not author, cherry-picked from LEDE https://bugs.lede-project.org/index.php?do=details&task_id=637&openedfrom=-1%2Bweek]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ gdb/ChangeLog | 5 +++++
+ gdb/common/signals-state-save-restore.c | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c
+index d11a9ae..734335c 100644
+--- a/gdb/common/signals-state-save-restore.c
++++ b/gdb/common/signals-state-save-restore.c
+@@ -41,7 +41,7 @@ save_original_signals_state (void)
+ int i;
+ int res;
+
+- res = sigprocmask (0, NULL, &original_signal_mask);
++ res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask);
+ if (res == -1)
+ perror_with_name (("sigprocmask"));
+
+--
+2.6.4
+