[PATCH] Use SIG_BLOCK instead of numeric constant

Simon Marchi simon.marchi@polymtl.ca
Tue Dec 18 20:26:00 GMT 2018


On 2018-12-16 14:39, info@mobile-stream.com wrote:
> gdb on mipsel-alpine-linux-musl* (at least) fails to start without
> this change because SIG_BLOCK is 1 not 0 on linux/mips (unlike most
> other architectures).
> 
> ---
>  gdb/common/signals-state-save-restore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/common/signals-state-save-restore.c
> b/gdb/common/signals-state-save-restore.c
> index 5bb66321bb..6597decbc6 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 (bool quiet)
>    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"));

There was a discussion about this last year:

   https://sourceware.org/ml/gdb-patches/2017-03/threads.html#00426

A bug was filed against the POSIX standard here:

   http://austingroupbugs.net/view.php?id=1132#c4124

... and the way it was clarified goes with GDB's interpretation.  So I 
guess musl's implementation will have to change to match.

Simon



More information about the Gdb-patches mailing list