libgo: change mksigtab to recognize glibc 2.26 NSIG expression

Fixes golang/go#21147
Fixes GCC PR 81617

Change-Id: I3d63704a45530faea28ab18278550c9b923f434f
Reviewed-on: https://go-review.googlesource.com/52611
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh
index c331970..2b07dd4 100755
--- a/libgo/mksigtab.sh
+++ b/libgo/mksigtab.sh
@@ -107,6 +107,19 @@
     nsig=`expr $nsig + 1`
 else
     nsig=`grep 'const _*NSIG = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
+    if test -z "$nsig"; then
+	if grep 'const _*NSIG = [ (]*_*SIGRTMAX + 1[ )]*' gen-sysinfo.go >/dev/null 2>&1; then
+	    rtmax=`grep 'const _*SIGRTMAX = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
+	    if test -n "$rtmax"; then
+		nsig=`expr $rtmax + 1`
+	    fi
+	fi
+    fi
+fi
+
+if test -z "$nsig"; then
+    echo 1>&2 "could not determine number of signals"
+    exit 1
 fi
 
 i=1