diff mbox

libgo patch committed: Update to Go1.8rc1

Message ID CAOyqgcUpXtaw1sCCOP5=gNph8xqjfmryycUDUpw7KPBefg4x_g@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Jan. 16, 2017, 1:21 a.m. UTC
On Sun, Jan 15, 2017 at 3:12 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> In file included from ../../../libgo/runtime/runtime.h:113:0,
>                  from ../../../libgo/runtime/go-libmain.c:15:
> ./runtime.inc:650:8: error: redefinition of 'struct siginfo'
>  struct siginfo {
>         ^~~~~~~
> In file included from /usr/include/signal.h:79:0,
>                  from ../../../libgo/runtime/runtime.h:9,
>                  from ../../../libgo/runtime/go-libmain.c:15:
> /usr/include/bits/siginfo.h:46:16: note: originally defined here
>  typedef struct siginfo
>                 ^~~~~~~
> In file included from ../../../libgo/runtime/runtime.h:113:0,
>                  from ../../../libgo/runtime/go-main.c:17:
> ./runtime.inc:650:8: error: redefinition of 'struct siginfo'
>  struct siginfo {
>         ^~~~~~~
> In file included from /usr/include/signal.h:79:0,
>                  from ../../../libgo/runtime/runtime.h:9,
>                  from ../../../libgo/runtime/go-main.c:17:
> /usr/include/bits/siginfo.h:46:16: note: originally defined here
>  typedef struct siginfo
>                 ^~~~~~~
> In file included from ../../../libgo/runtime/runtime.h:113:0,
>                  from ../../../libgo/runtime/aeshash.c:7:
> ./runtime.inc:650:8: error: redefinition of 'struct siginfo'
>  struct siginfo {
>         ^~~~~~~
> In file included from /usr/include/signal.h:79:0,
>                  from ../../../libgo/runtime/runtime.h:9,
>                  from ../../../libgo/runtime/aeshash.c:7:
> /usr/include/bits/siginfo.h:46:16: note: originally defined here
>  typedef struct siginfo
>                 ^~~~~~~
> make[4]: *** [libgobegin_a-go-main.o] Error 1

Thanks.  I committed this patch, which I think should fix the problem.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.

Ian

Comments

Rainer Orth Jan. 16, 2017, 3:21 p.m. UTC | #1
Hi Ian,

> On Sun, Jan 15, 2017 at 3:12 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> In file included from ../../../libgo/runtime/runtime.h:113:0,
>>                  from ../../../libgo/runtime/go-libmain.c:15:
>> ./runtime.inc:650:8: error: redefinition of 'struct siginfo'
>>  struct siginfo {
>>         ^~~~~~~
>> In file included from /usr/include/signal.h:79:0,
>>                  from ../../../libgo/runtime/runtime.h:9,
>>                  from ../../../libgo/runtime/go-libmain.c:15:
>> /usr/include/bits/siginfo.h:46:16: note: originally defined here
>>  typedef struct siginfo
>>                 ^~~~~~~
>> In file included from ../../../libgo/runtime/runtime.h:113:0,
>>                  from ../../../libgo/runtime/go-main.c:17:
>> ./runtime.inc:650:8: error: redefinition of 'struct siginfo'
>>  struct siginfo {
>>         ^~~~~~~
>> In file included from /usr/include/signal.h:79:0,
>>                  from ../../../libgo/runtime/runtime.h:9,
>>                  from ../../../libgo/runtime/go-main.c:17:
>> /usr/include/bits/siginfo.h:46:16: note: originally defined here
>>  typedef struct siginfo
>>                 ^~~~~~~
>> In file included from ../../../libgo/runtime/runtime.h:113:0,
>>                  from ../../../libgo/runtime/aeshash.c:7:
>> ./runtime.inc:650:8: error: redefinition of 'struct siginfo'
>>  struct siginfo {
>>         ^~~~~~~
>> In file included from /usr/include/signal.h:79:0,
>>                  from ../../../libgo/runtime/runtime.h:9,
>>                  from ../../../libgo/runtime/aeshash.c:7:
>> /usr/include/bits/siginfo.h:46:16: note: originally defined here
>>  typedef struct siginfo
>>                 ^~~~~~~
>> make[4]: *** [libgobegin_a-go-main.o] Error 1
>
> Thanks.  I committed this patch, which I think should fix the problem.
> Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.

I'm getting further on Solaris now, but the build still fails:

/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/syscall.go:16:3: error: procIoctl is not a function; //go:linkname is only supported for functions
 //go:linkname procIoctl libc_ioctl
   ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:27:43: error: reference to undefined name 'sysAF_INET'
 func (a *Inet4Addr) Family() int { return sysAF_INET }
                                           ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:37:43: error: reference to undefined name 'sysAF_INET6'
 func (a *Inet6Addr) Family() int { return sysAF_INET6 }
                                           ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:59:12: error: use of undefined type 'lifreq'
   var lifr lifreq
            ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:61:8: error: reference to field 'Name' in object which has no fields or methods
    lifr.Name[i] = int8(ll.Name[i])
        ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:64:17: error: reference to undefined name 'sysSIOCGLIFADDR'
    ioc := int64(sysSIOCGLIFADDR)
                 ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:69:12: error: reference to undefined name 'sockaddrStorage'
    sa := (*sockaddrStorage)(unsafe.Pointer(&lifr.Lifru[0]))
            ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:69:11: error: expected pointer
    sa := (*sockaddrStorage)(unsafe.Pointer(&lifr.Lifru[0]))
           ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:69:49: error: reference to field 'Lifru' in object which has no fields or methods
    sa := (*sockaddrStorage)(unsafe.Pointer(&lifr.Lifru[0]))
                                                 ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:70:37: error: reference to field 'Lifru1' in object which has no fields or methods
    l := int(littleEndian.Uint32(lifr.Lifru1[:4]))
                                     ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:75:9: error: reference to undefined name 'sysAF_INET'
    case sysAF_INET:
         ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:77:23: error: reference to field 'Lifru' in object which has no fields or methods
     copy(a.IP[:], lifr.Lifru[4:8])
                       ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:79:9: error: reference to undefined name 'sysAF_INET6'
    case sysAF_INET6:
         ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:80:71: error: reference to field 'Lifru' in object which has no fields or methods
     a := &Inet6Addr{PrefixLen: l, ZoneID: int(littleEndian.Uint32(lifr.Lifru[24:28]))}
                                                                       ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:81:23: error: reference to field 'Lifru' in object which has no fields or methods
     copy(a.IP[:], lifr.Lifru[8:24])
                       ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/lif.go:27:15: error: reference to undefined name 'sysAF_INET'
  afs := []int{sysAF_INET, sysAF_INET6}
               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/lif.go:27:27: error: reference to undefined name 'sysAF_INET6'
  afs := []int{sysAF_INET, sysAF_INET6}
                           ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/lif.go:28:11: error: reference to undefined name 'sysAF_UNSPEC'
  if af != sysAF_UNSPEC {
           ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/lif.go:32:32: error: reference to undefined name 'sysSOCK_DGRAM'
   s, err := syscall.Socket(af, sysSOCK_DGRAM, 0)
                                ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/address.go:59:12: error: use of undefined type 'lifreq'
   var lifr lifreq
            ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:30:7: error: reference to field 'Name' in object which has no fields or methods
   lifr.Name[i] = int8(ll.Name[i])
       ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:32:15: error: reference to undefined name 'sysSIOCGLIFINDEX'
  ioc := int64(sysSIOCGLIFINDEX)
               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:34:42: error: reference to field 'Lifru' in object which has no fields or methods
   ll.Index = int(littleEndian.Uint32(lifr.Lifru[:4]))
                                          ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:36:14: error: reference to undefined name 'sysSIOCGLIFFLAGS'
  ioc = int64(sysSIOCGLIFFLAGS)
              ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:38:42: error: reference to field 'Lifru' in object which has no fields or methods
   ll.Flags = int(littleEndian.Uint64(lifr.Lifru[:8]))
                                          ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:40:14: error: reference to undefined name 'sysSIOCGLIFMTU'
  ioc = int64(sysSIOCGLIFMTU)
              ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:42:40: error: reference to field 'Lifru' in object which has no fields or methods
   ll.MTU = int(littleEndian.Uint32(lifr.Lifru[:4]))
                                        ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:45:7: error: reference to undefined name 'sysIFT_IPV4'
  case sysIFT_IPV4, sysIFT_IPV6, sysIFT_6TO4:
       ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:45:20: error: reference to undefined name 'sysIFT_IPV6'
  case sysIFT_IPV4, sysIFT_IPV6, sysIFT_6TO4:
                    ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:45:33: error: reference to undefined name 'sysIFT_6TO4'
  case sysIFT_IPV4, sysIFT_IPV6, sysIFT_6TO4:
                                 ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:47:15: error: reference to undefined name 'sysSIOCGLIFHWADDR'
   ioc = int64(sysSIOCGLIFHWADDR)
               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:49:35: error: reference to field 'Lifru' in object which has no fields or methods
    ll.Addr, _ = parseLinkAddr(lifr.Lifru[4:])
                                   ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:73:27: error: reference to undefined name 'sysLIFC_NOXMIT'
  lifn := sysLifnum{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
                           ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:73:44: error: reference to undefined name 'sysLIFC_TEMPORARY'
  lifn := sysLifnum{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
                                            ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:73:64: error: reference to undefined name 'sysLIFC_ALLZONES'
  lifn := sysLifnum{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
                                                                ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:73:83: error: reference to undefined name 'sysLIFC_UNDER_IPMP'
  lifn := sysLifnum{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
                                                                                   ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:73:10: error: use of undefined type 'sysLifnum'
  lifn := sysLifnum{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
          ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:74:25: error: reference to undefined name 'sysLIFC_NOXMIT'
  lifc := lifconf{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
                         ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:74:42: error: reference to undefined name 'sysLIFC_TEMPORARY'
  lifc := lifconf{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
                                          ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:74:62: error: reference to undefined name 'sysLIFC_ALLZONES'
  lifc := lifconf{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
                                                              ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:74:81: error: reference to undefined name 'sysLIFC_UNDER_IPMP'
  lifc := lifconf{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
                                                                                 ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:74:10: error: use of undefined type 'lifconf'
  lifc := lifconf{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
          ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:77:16: error: reference to undefined name 'sysSIOCGLIFNUM'
   ioc := int64(sysSIOCGLIFNUM)
                ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:84:32: error: reference to undefined name 'sizeofLifreq'
   b := make([]byte, lifn.Count*sizeofLifreq)
                                ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:86:27: error: reference to undefined name 'sizeofLifreq'
   lifc.Len = lifn.Count * sizeofLifreq
                           ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:88:15: error: reference to undefined name 'sysSIOCGLIFCONF'
   ioc = int64(sysSIOCGLIFCONF)
               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:94:14: error: reference to undefined name 'lifreq'
    lifr := (*lifreq)(unsafe.Pointer(&b[i*sizeofLifreq]))
              ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:94:13: error: expected pointer
    lifr := (*lifreq)(unsafe.Pointer(&b[i*sizeofLifreq]))
             ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/link.go:94:42: error: reference to undefined name 'sizeofLifreq'
    lifr := (*lifreq)(unsafe.Pointer(&b[i*sizeofLifreq]))
                                          ^

This seems to need a version of defs_solaris.go that works with the
constants and structs living in syscall.

	Rainer
diff mbox

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 244483)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-a28b04adaeff8de61c336374db66b24ed96c30f0
+223cba75b947afc1ee5a13a60c15c66f6ff355c1
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/runtime/signal_gccgo.go
===================================================================
--- libgo/go/runtime/signal_gccgo.go	(revision 244456)
+++ libgo/go/runtime/signal_gccgo.go	(working copy)
@@ -46,15 +46,13 @@  func kill(pid _pid_t, sig uint32) int32
 //extern setitimer
 func setitimer(which int32, new *_itimerval, old *_itimerval) int32
 
-type siginfo _siginfo_t
-
 type sigTabT struct {
 	flags int32
 	name  string
 }
 
 type sigctxt struct {
-	info *siginfo
+	info *_siginfo_t
 	ctxt unsafe.Pointer
 }
 
@@ -128,9 +126,9 @@  func raiseproc(sig uint32) {
 
 //go:nosplit
 //go:nowritebarrierrec
-func sigfwd(fn uintptr, sig uint32, info *siginfo, ctx unsafe.Pointer) {
+func sigfwd(fn uintptr, sig uint32, info *_siginfo_t, ctx unsafe.Pointer) {
 	f1 := &[1]uintptr{fn}
-	f2 := *(*func(uint32, *siginfo, unsafe.Pointer))(unsafe.Pointer(&f1))
+	f2 := *(*func(uint32, *_siginfo_t, unsafe.Pointer))(unsafe.Pointer(&f1))
 	f2(sig, info, ctx)
 }
 
Index: libgo/go/runtime/signal_sighandler.go
===================================================================
--- libgo/go/runtime/signal_sighandler.go	(revision 244456)
+++ libgo/go/runtime/signal_sighandler.go	(working copy)
@@ -25,7 +25,7 @@  var crashing int32
 // are not allowed.
 //
 //go:nowritebarrierrec
-func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) {
+func sighandler(sig uint32, info *_siginfo_t, ctxt unsafe.Pointer, gp *g) {
 	_g_ := getg()
 	c := sigctxt{info, ctxt}
 
Index: libgo/go/runtime/signal_unix.go
===================================================================
--- libgo/go/runtime/signal_unix.go	(revision 244456)
+++ libgo/go/runtime/signal_unix.go	(working copy)
@@ -202,7 +202,7 @@  func sigpipe() {
 // This is called by the signal handler, and the world may be stopped.
 //go:nosplit
 //go:nowritebarrierrec
-func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
+func sigtrampgo(sig uint32, info *_siginfo_t, ctx unsafe.Pointer) {
 	if sigfwdgo(sig, info, ctx) {
 		return
 	}
@@ -446,7 +446,7 @@  func badsignal(sig uintptr, c *sigctxt)
 // This is called by the signal handler, and the world may be stopped.
 //go:nosplit
 //go:nowritebarrierrec
-func sigfwdgo(sig uint32, info *siginfo, ctx unsafe.Pointer) bool {
+func sigfwdgo(sig uint32, info *_siginfo_t, ctx unsafe.Pointer) bool {
 	if sig >= uint32(len(sigtable)) {
 		return false
 	}
Index: libgo/go/runtime/stubs.go
===================================================================
--- libgo/go/runtime/stubs.go	(revision 244456)
+++ libgo/go/runtime/stubs.go	(working copy)
@@ -485,10 +485,10 @@  func setSigactionHandler(*_sigaction, ui
 // Retrieve fields from the siginfo_t and ucontext_t pointers passed
 // to a signal handler using C, as they are often hidden in a union.
 // Returns  and, if available, PC where signal occurred.
-func getSiginfo(*siginfo, unsafe.Pointer) (sigaddr uintptr, sigpc uintptr)
+func getSiginfo(*_siginfo_t, unsafe.Pointer) (sigaddr uintptr, sigpc uintptr)
 
 // Implemented in C for gccgo.
-func dumpregs(*siginfo, unsafe.Pointer)
+func dumpregs(*_siginfo_t, unsafe.Pointer)
 
 // Temporary for gccgo until we port proc.go.
 //go:linkname getsched runtime.getsched