summaryrefslogtreecommitdiffstats
path: root/libgo
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2022-04-15 11:04:15 +0200
committerIan Lance Taylor <iant@golang.org>2022-04-18 15:17:16 -0700
commitace4928a29b79ac6aa0c84d6fd78f5dce5fa6190 (patch)
tree64aa57e81be8fd8f39d9e9395929dd11c976f55c /libgo
parentruntime: add special handling for signal 34 (diff)
downloadgcc-ace4928a29b79ac6aa0c84d6fd78f5dce5fa6190.tar.gz
gcc-ace4928a29b79ac6aa0c84d6fd78f5dce5fa6190.tar.bz2
gcc-ace4928a29b79ac6aa0c84d6fd78f5dce5fa6190.tar.xz
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
Diffstat (limited to 'libgo')
-rw-r--r--libgo/mksigtab.sh8
1 files changed, 6 insertions, 2 deletions
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=""
26# Handle signals valid on all Unix systems. 26# Handle signals valid on all Unix systems.
27 27
28addsig() { 28addsig() {
29 echo " $1: $2,"
30 # Get the signal number and add it to SIGLIST 29 # Get the signal number and add it to SIGLIST
31 signum=`grep "const $1 = " gen-sysinfo.go | sed -e 's/.* = //'` 30 signum=`grep "const $1 = " gen-sysinfo.go | sed -e 's/.* = //'`
32 if echo "$signum" | grep '^_SIG[A-Z0-9_]*$' >/dev/null 2>&1; then 31 if echo "$signum" | grep '^_SIG[A-Z0-9_]*$' >/dev/null 2>&1; then
@@ -34,7 +33,12 @@ addsig() {
34 # This is needed for some MIPS signals defined as aliases of other signals 33 # This is needed for some MIPS signals defined as aliases of other signals
35 signum=`grep "const $signum = " gen-sysinfo.go | sed -e 's/.* = //'` 34 signum=`grep "const $signum = " gen-sysinfo.go | sed -e 's/.* = //'`
36 fi 35 fi
37 SIGLIST=$SIGLIST"_${signum}_" 36 # Only add signal if the signal number isn't in the list yet.
37 # For example, musl libc uses signal 29 for both SIGIO and SIGPOLL.
38 if ! echo "$SIGLIST" | grep "_${signum}_" >/dev/null 2>&1; then
39 echo " $1: $2,"
40 SIGLIST=$SIGLIST"_${signum}_"
41 fi
38} 42}
39 43
40echo ' 0: {0, "SIGNONE: no trap"},' 44echo ' 0: {0, "SIGNONE: no trap"},'