diff mbox

libgo patch committed: Fix signal counting for glibc 2.26

Message ID CAOyqgcWYewjAjjKRmqhYYYsSWsO2SL=+3ewBnVGC-Vj6NFASBQ@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Aug. 3, 2017, 6:11 p.m. UTC
This patch to libgo changes the mksigtab script to recognize the glibc
2.26 NSIG expression.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.  Will commit to GCC 7
branch when it reopens.  This fixes GCC PR 81617 and
https://golang.org/issue/21147.

Ian

Comments

Richard Biener Aug. 4, 2017, 7:22 a.m. UTC | #1
On Thu, Aug 3, 2017 at 8:11 PM, Ian Lance Taylor <iant@golang.org> wrote:
> This patch to libgo changes the mksigtab script to recognize the glibc
> 2.26 NSIG expression.  Bootstrapped and ran Go testsuite on
> x86_64-pc-linux-gnu.  Committed to mainline.  Will commit to GCC 7
> branch when it reopens.  This fixes GCC PR 81617 and
> https://golang.org/issue/21147.

The patch looks pretty safe as it only changes things when nsig is empty
so can you install it on the branch now so that 7.2 will build Go fine with
glibc 2.26?

Thanks,
Richard.

>
> Ian
Ian Lance Taylor Aug. 4, 2017, 12:30 p.m. UTC | #2
On Fri, Aug 4, 2017 at 12:22 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Thu, Aug 3, 2017 at 8:11 PM, Ian Lance Taylor <iant@golang.org> wrote:
>> This patch to libgo changes the mksigtab script to recognize the glibc
>> 2.26 NSIG expression.  Bootstrapped and ran Go testsuite on
>> x86_64-pc-linux-gnu.  Committed to mainline.  Will commit to GCC 7
>> branch when it reopens.  This fixes GCC PR 81617 and
>> https://golang.org/issue/21147.
>
> The patch looks pretty safe as it only changes things when nsig is empty
> so can you install it on the branch now so that 7.2 will build Go fine with
> glibc 2.26?

Done.

Ian
diff mbox

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 250832)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-c1ac6bc99f988633c6bc68a5ca9ffad3487750ef
+adac632f95d1cd3421c9c1df5204db10b6a92c44
 
 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 250406)
+++ libgo/mksigtab.sh	(working copy)
@@ -107,6 +107,19 @@  if test "${GOOS}" = "aix"; then
     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