This patch by James Cowgill fixes signal aliases when libgo works out
the signal table.  On MIPS, SIGABRT is defined like this:

#define SIGIOT   6
#define SIGABRT  SIGIOT

This confused the mksigtab.sh script in libgo.  This patch fixes the
problem.  Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.
Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 247947)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-fc3d6af694c518d73a126bcbd90d79982524f9f6
+3c1258156a2ae483c5cc523cb7a3c3374cbe7c2c
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/mksigtab.sh
===================================================================
--- libgo/mksigtab.sh   (revision 247848)
+++ libgo/mksigtab.sh   (working copy)
@@ -28,7 +28,12 @@ SIGLIST=""
 addsig() {
     echo "     $1: $2,"
     # Get the signal number and add it to SIGLIST
-    signum=`grep "const $1 = " gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
+    signum=`grep "const $1 = " gen-sysinfo.go | sed -e 's/.* = //'`
+    if echo "$signum" | grep -q '^_SIG[A-Z0-9_]*$'; then
+        # Recurse once to obtain signal number
+        # 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}_"
 }
 

Reply via email to