From b95b767de888202b3061ace002b8290dfbcc2822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Fri, 12 Mar 2021 15:10:25 -0300 Subject: [PATCH] gdb: fix musl patch. Use patch from Alpine. __SIGRTMIN and SIGRTMIN aren't the same thing: SIGRTMIN is for signals applications can use, for which musl currently returns 35, but __SIGRTMIN is supposed to include the signals that libc uses, where the correct value is 32. We also extend their patch to include the nostop changes from void, though they don't seem to be explicitly doing something. --- srcpkgs/gdb/patches/gdb-linux_nat.patch | 21 -------------------- srcpkgs/gdb/patches/gdb-signals.patch | 26 +++++++++++++++++++++++++ srcpkgs/gdb/template | 2 +- 3 files changed, 27 insertions(+), 22 deletions(-) delete mode 100644 srcpkgs/gdb/patches/gdb-linux_nat.patch create mode 100644 srcpkgs/gdb/patches/gdb-signals.patch diff --git a/srcpkgs/gdb/patches/gdb-linux_nat.patch b/srcpkgs/gdb/patches/gdb-linux_nat.patch deleted file mode 100644 index 53f3132d36c..00000000000 --- a/srcpkgs/gdb/patches/gdb-linux_nat.patch +++ /dev/null @@ -1,21 +0,0 @@ -the first chunk fixes build errors, -the non_stop part below fixes thread debugging being available -by default without setting any breakpoints or usage of libthread_db. - ---- gdb-7.4.org/gdb/linux-nat.c 2013-08-10 05:24:24.651000003 +0000 -+++ gdb-7.4/gdb/linux-nat.c 2013-08-10 05:25:50.966000003 +0000 -@@ -71,6 +71,14 @@ - # endif - #endif /* HAVE_PERSONALITY */ - -+#ifndef __SIGRTMIN -+#define __SIGRTMIN SIGRTMIN -+#endif -+ -+#ifndef W_STOPCODE -+#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) -+#endif -+ - /* This comment documents high-level logic of this file. - - Waiting for events in sync mode diff --git a/srcpkgs/gdb/patches/gdb-signals.patch b/srcpkgs/gdb/patches/gdb-signals.patch new file mode 100644 index 00000000000..5f5502dc0dd --- /dev/null +++ b/srcpkgs/gdb/patches/gdb-signals.patch @@ -0,0 +1,26 @@ +the first chunk fixes build errors, +the non_stop part below fixes thread debugging being available +by default without setting any breakpoints or usage of libthread_db. + +diff --git a/gdbsupport/signals.cc b/gdbsupport/signals.cc +index 485e0f0..955aec1 100644 +--- a/gdbsupport/signals.cc ++++ b/gdbsupport/signals.cc +@@ -31,6 +31,17 @@ struct gdbarch; + _available_ realtime signal, not the lowest supported; glibc takes + several for its own use. */ + ++#ifndef __SIGRTMIN ++# define __SIGRTMIN 32 ++#endif ++#ifndef __SIGRTMAX ++# define __SIGRTMAX _NSIG ++#endif ++ ++#ifndef W_STOPCODE ++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) ++#endif ++ + #ifndef REALTIME_LO + # if defined(__SIGRTMIN) + # define REALTIME_LO __SIGRTMIN diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template index e2a39e7d103..e63224696bd 100644 --- a/srcpkgs/gdb/template +++ b/srcpkgs/gdb/template @@ -1,7 +1,7 @@ # Template file for 'gdb' pkgname=gdb version=10.1 -revision=2 +revision=3 build_style=gnu-configure pycompile_dirs="/usr/share/gdb/python" configure_args="--disable-werror --disable-nls --with-system-readline