diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-05-12 01:09:42 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-05-12 01:09:42 +0000 |
commit | fa846918fc9361a1ae52efc503b44519f33293d2 (patch) | |
tree | 8c2214235d0949cc54279d882d6f359adf340680 /libgo | |
parent | b3a7fdc3eadb551659dedf47c2a6faf0d569a278 (diff) | |
download | gcc-fa846918fc9361a1ae52efc503b44519f33293d2.zip gcc-fa846918fc9361a1ae52efc503b44519f33293d2.tar.gz gcc-fa846918fc9361a1ae52efc503b44519f33293d2.tar.bz2 |
mksigtab.sh: recurse once when adding signals to SIGLIST
On MIPS, SIGABRT is defined like this:
#define SIGIOT 6
#define SIGABRT SIGIOT
This breaks addsig which tries to append __SIGIOT_ to SIGLIST. Signal
number 6 is later added to the output and go complains about a
duplicate signal number.
Fix by recursing once when obtaining the signal number from
gen-sysinfo.go if the signal is defined as an alias of another signal.
Also modify the sed expression to 's/.* = //' which is equivalent to
the original expression but is less misleading given that it might not
match a number.
Reviewed-on: https://go-review.googlesource.com/43252
From-SVN: r247948
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/mksigtab.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh index 22547ff..c331970 100644 --- a/libgo/mksigtab.sh +++ b/libgo/mksigtab.sh @@ -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}_" } |