diff mbox

libgo patch committed: Fix quoting in mksigtab.sh

Message ID ydd1suicc3t.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Feb. 28, 2017, 8:08 p.m. UTC
Hi Ian,

> I goofed on the shell quoting in mksigtab.sh, causing various
> system-specific signals to be entered incorrectly in the runtime
> signal table.  This patch fixes the problem.  The test for this is
> misc/cgo/testcarchive in the master repo, which
> we don't yet run for gccgo.  Bootstrapped and ran Go testsuite on
> x86_64-pc-linux-gnu.  Committed to mainline.

this broke Solaris bootstrap:

sigtab.go:38:2: error: duplicate value for index 22
  _SIGPOLL:    {_SigNotify, "SIGPOLL: pollable event occurred"},
  ^
/vol/gcc/src/hg/trunk/local/libgo/go/runtime/signal_unix.go:395:3: error: range clause must have array, slice, string, map, or channel type
   for i := range sigtable {
   ^
/vol/gcc/src/hg/trunk/local/libgo/go/runtime/signal_unix.go:591:2: error: range clause must have array, slice, string, map, or channel type
  for i := range sigtable {
  ^
/vol/gcc/src/hg/trunk/local/libgo/go/runtime/signal_unix.go:395:7: error: invalid type for range clause
   for i := range sigtable {
       ^
/vol/gcc/src/hg/trunk/local/libgo/go/runtime/signal_unix.go:591:6: error: invalid type for range clause
  for i := range sigtable {
      ^
Makefile:3333: recipe for target 'runtime.lo' failed
make[4]: *** [runtime.lo] Error 1

<sys/iso/signal_iso.h> has

#define SIGPOLL 22      /* pollable event occurred */
#define SIGIO   SIGPOLL /* socket I/O possible (SIGPOLL alias) */

this leads to

const _SIGIO = _SIGPOLL

and similarly

const _SIGLWP = _SIGAIOCANCEL

in gen-sysinfo.go.

Fixed like this, which allows runtime.lo to compile.

	Rainer

Comments

Ian Lance Taylor Feb. 28, 2017, 10:31 p.m. UTC | #1
On Tue, Feb 28, 2017 at 12:08 PM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> Hi Ian,
>
>> I goofed on the shell quoting in mksigtab.sh, causing various
>> system-specific signals to be entered incorrectly in the runtime
>> signal table.  This patch fixes the problem.  The test for this is
>> misc/cgo/testcarchive in the master repo, which
>> we don't yet run for gccgo.  Bootstrapped and ran Go testsuite on
>> x86_64-pc-linux-gnu.  Committed to mainline.
>
> this broke Solaris bootstrap:
>
> sigtab.go:38:2: error: duplicate value for index 22
>   _SIGPOLL:    {_SigNotify, "SIGPOLL: pollable event occurred"},
>   ^
> /vol/gcc/src/hg/trunk/local/libgo/go/runtime/signal_unix.go:395:3: error: range clause must have array, slice, string, map, or channel type
>    for i := range sigtable {
>    ^
> /vol/gcc/src/hg/trunk/local/libgo/go/runtime/signal_unix.go:591:2: error: range clause must have array, slice, string, map, or channel type
>   for i := range sigtable {
>   ^
> /vol/gcc/src/hg/trunk/local/libgo/go/runtime/signal_unix.go:395:7: error: invalid type for range clause
>    for i := range sigtable {
>        ^
> /vol/gcc/src/hg/trunk/local/libgo/go/runtime/signal_unix.go:591:6: error: invalid type for range clause
>   for i := range sigtable {
>       ^
> Makefile:3333: recipe for target 'runtime.lo' failed
> make[4]: *** [runtime.lo] Error 1
>
> <sys/iso/signal_iso.h> has
>
> #define SIGPOLL 22      /* pollable event occurred */
> #define SIGIO   SIGPOLL /* socket I/O possible (SIGPOLL alias) */
>
> this leads to
>
> const _SIGIO = _SIGPOLL
>
> and similarly
>
> const _SIGLWP = _SIGAIOCANCEL
>
> in gen-sysinfo.go.
>
> Fixed like this, which allows runtime.lo to compile.

Thanks.

Committed to mainline.

Ian
diff mbox

Patch

diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh
--- a/libgo/mksigtab.sh
+++ b/libgo/mksigtab.sh
@@ -56,7 +56,8 @@  echo '	_SIGSYS:    {_SigThrow, "SIGSYS: 
 # Handle signals that are not supported on all systems.
 
 checksig() {
-    if grep "const $1 = " gen-sysinfo.go >/dev/null 2>&1; then
+    if grep "const $1 = " gen-sysinfo.go >/dev/null 2>&1 \
+	&& ! grep "const $1 = _SIG" gen-sysinfo.go > /dev/null 2>&1; then
 	echo "	$1: $2,"
     fi
 }