]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgo/mksigtab.sh
Fix boostrap failure in tree-ssa-loop-ch.cc
[thirdparty/gcc.git] / libgo / mksigtab.sh
index c68b28be3afe0a63d46fc1071510022338a98991..bea8739957ea7a89d70d918c35ab4ee06f823d63 100644 (file)
@@ -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"},'
@@ -91,13 +95,16 @@ checksig _SIGCANCEL  '{_SigSetStack + _SigUnblock, "SIGCANCEL: reserved signal f
 checksig _SIGXRES    '{_SigNotify, "SIGXRES: resource control exceeded"}'
 checksig _SIGJVM1    '{_SigNotify, "SIGJVM1: reserved signal for Java Virtual Machine"}'
 checksig _SIGJVM2    '{_SigNotify, "SIGJVM2: reserved signal for Java Virtual Machine"}'
+checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (GNU)"}'
 
 # 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
@@ -112,6 +119,11 @@ else
            rtmax=`grep 'const _*SIGRTMAX = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
            if test -n "$rtmax"; then
                nsig=`expr $rtmax + 1`
+           elif grep 'const _*SIGRTMAX = [ (]*_*SIGRTMIN[ )]*' gen-sysinfo.go >/dev/null 2>&1; then
+               rtmin=`grep 'const _*SIGRTMIN = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
+               if test -n "$rtmin"; then
+                   nsig=`expr $rtmin + 1`
+               fi
            fi
        fi
     fi