public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-8186] runtime: add special handling for signal 34
Date: Mon, 18 Apr 2022 22:18:08 +0000 (GMT)	[thread overview]
Message-ID: <20220418221808.062893858D1E@sourceware.org> (raw)

https://gcc.gnu.org/g:208b7d85d73cbd166e207f0e062cccbdfbf52bb3

commit r12-8186-g208b7d85d73cbd166e207f0e062cccbdfbf52bb3
Author: A. Wilcox <AWilcox@Wilcox-Tech.com>
Date:   Sun Aug 30 17:30:07 2020 +0200

    runtime: add special handling for signal 34
    
    The musl libc uses signal 34 internally for setgid (similar to how glibc
    uses signal 32 and signal 33).  For this reason, special handling is
    needed for this signal in the runtime. The gc implementation already
    handles the signal accordingly.  As such, this commit intends to
    simply copy the behavior of the Google Go implementation to libgo.
    
    See https://go.dev/issues/39343
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/400594

Diff:
---
 gcc/go/gofrontend/MERGE          | 2 +-
 libgo/go/runtime/signal_gccgo.go | 3 ++-
 libgo/mksigtab.sh                | 4 +++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index bcb526c85b9..eeff61d82f8 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-62fc90f52da2f52cbe3b4f10e560dc6aa59baeb5
+8336fe4a5da68d9188dfbc4fb647ccbbe4d60ba4
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/libgo/go/runtime/signal_gccgo.go b/libgo/go/runtime/signal_gccgo.go
index 2eece687e35..82e6996ab7e 100644
--- a/libgo/go/runtime/signal_gccgo.go
+++ b/libgo/go/runtime/signal_gccgo.go
@@ -106,7 +106,8 @@ func getsig(i uint32) uintptr {
 	if sigaction(i, nil, &sa) < 0 {
 		// On GNU/Linux glibc rejects attempts to call
 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
-		if GOOS == "linux" && (i == 32 || i == 33) {
+		// On musl signal 34 (SIGSYNCCALL) also needs to be treated accordingly.
+		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
 			return _SIG_DFL
 		}
 		throw("sigaction read failure")
diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh
index 11e4ec436bd..cdf6fcd823f 100644
--- a/libgo/mksigtab.sh
+++ b/libgo/mksigtab.sh
@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
 
 # Special handling of signals 32 and 33 on GNU/Linux systems,
 # because they are special to glibc.
+# Signal 34 is additionally special to Linux systems with musl.
 if test "${GOOS}" = "linux"; then
-    SIGLIST=$SIGLIST"_32__33_"
+    SIGLIST=$SIGLIST"_32__33__34_"
     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
+    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* musl SIGSYNCCALL; see issue 39343 */'
 fi
 
 if test "${GOOS}" = "aix"; then


                 reply	other threads:[~2022-04-18 22:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220418221808.062893858D1E@sourceware.org \
    --to=ian@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).