public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-8187] libgo: only add signum to siglist if it doesn't exist yet
@ 2022-04-18 22:18 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2022-04-18 22:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ace4928a29b79ac6aa0c84d6fd78f5dce5fa6190

commit r12-8187-gace4928a29b79ac6aa0c84d6fd78f5dce5fa6190
Author: Sören Tempel <soeren+git@soeren-tempel.net>
Date:   Fri Apr 15 11:04:15 2022 +0200

    libgo: only add signum to siglist if it doesn't exist yet
    
    This fixes a build issue on musl libc where the same signal number
    is used for SIGIO and SIGPOLL.  This causes a compilation error since
    the signal numbers must be unique for the signal table.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/400595

Diff:
---
 gcc/go/gofrontend/MERGE | 2 +-
 libgo/mksigtab.sh       | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index eeff61d82f8..2321f67ca5d 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-8336fe4a5da68d9188dfbc4fb647ccbbe4d60ba4
+22b0ccda3aa4d16f770a26a3eb251f8da615c318
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh
index cdf6fcd823f..bea8739957e 100644
--- a/libgo/mksigtab.sh
+++ b/libgo/mksigtab.sh
@@ -26,7 +26,6 @@ SIGLIST=""
 # Handle signals valid on all Unix systems.
 
 addsig() {
-    echo "	$1: $2,"
     # Get the signal number and add it to SIGLIST
     signum=`grep "const $1 = " gen-sysinfo.go | sed -e 's/.* = //'`
     if echo "$signum" | grep '^_SIG[A-Z0-9_]*$' >/dev/null 2>&1; then
@@ -34,7 +33,12 @@ addsig() {
         # This is needed for some MIPS signals defined as aliases of other signals
         signum=`grep "const $signum = " gen-sysinfo.go | sed -e 's/.* = //'`
     fi
-    SIGLIST=$SIGLIST"_${signum}_"
+    # Only add signal if the signal number isn't in the list yet.
+    # For example, musl libc uses signal 29 for both SIGIO and SIGPOLL.
+    if ! echo "$SIGLIST" | grep "_${signum}_" >/dev/null 2>&1; then
+        echo "	$1: $2,"
+        SIGLIST=$SIGLIST"_${signum}_"
+    fi
 }
 
 echo '	0:          {0, "SIGNONE: no trap"},'


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-18 22:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 22:18 [gcc r12-8187] libgo: only add signum to siglist if it doesn't exist yet Ian Lance Taylor

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).