summaryrefslogtreecommitdiff
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
parent208b7d85d73cbd166e207f0e062cccbdfbf52bb3 (diff)
downloadgcc-ace4928a29b79ac6aa0c84d6fd78f5dce5fa6190.tar.gz
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=""
# 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"},'