public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgo patch committed: Update to Go1.8rc1
@ 2017-01-14  0:06 Ian Lance Taylor
  2017-01-15 11:12 ` Andreas Schwab
  2017-01-17 16:10 ` Lynn A. Boger
  0 siblings, 2 replies; 13+ messages in thread
From: Ian Lance Taylor @ 2017-01-14  0:06 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

I committed a patch to libgo to update the library to the first
release candidate of the upcoming Go 1.8 release.  This is a big
update, mostly a straight copy of the code in the master Go library.

I made the following changes to the Go frontend to correspond to
changes in the runtime library:

* Change map assignment to use mapassign and assign value directly.
* Change string iteration to use decoderune, faster for ASCII strings.
* Change makeslice to take int, and use makeslice64 for larger values.
* Add new noverflow field to hmap struct used for maps.

There are two known problems that I simply commented out of test code
until they can be fixed:

* Commented out test in go/types/sizes_test.go that doesn't compile.
* Commented out reflect.TestStructOf test for padding after zero-sized field.

As usual with these sorts of updates the patch is too large to send to
the mailing list.  I've appended the changes to the gccgo-specific
parts of the code.

Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  I would not
be terribly surprised if this breaks Solaris.  I'll try to check that
out shortly.

Ian

gotools/ChangeLog:

2017-01-13  Ian Lance Taylor  <iant@golang.org>

Updates for Go 1.8rc1.
* Makefile.am (go_cmd_go_files): Add bug.go.
(s-zdefaultcc): Write defaultPkgConfig.

[-- Attachment #2: patch.txt.gz --]
[-- Type: application/x-gzip, Size: 80872 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-14  0:06 libgo patch committed: Update to Go1.8rc1 Ian Lance Taylor
@ 2017-01-15 11:12 ` Andreas Schwab
  2017-01-15 18:08   ` Rainer Orth
  2017-01-16  1:21   ` Ian Lance Taylor
  2017-01-17 16:10 ` Lynn A. Boger
  1 sibling, 2 replies; 13+ messages in thread
From: Andreas Schwab @ 2017-01-15 11:12 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev

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

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-15 11:12 ` Andreas Schwab
@ 2017-01-15 18:08   ` Rainer Orth
  2017-01-16  1:05     ` Ian Lance Taylor
  2017-01-16  1:21   ` Ian Lance Taylor
  1 sibling, 1 reply; 13+ messages in thread
From: Rainer Orth @ 2017-01-15 18:08 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Ian Lance Taylor, gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1829 bytes --]

Andreas Schwab <schwab@linux-m68k.org> writes:

> 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

Same on Solaris.  However, before I even get there, I hit

make[4]: *** No rule to make target 'golang_org/x/net/lif/lif.lo', needed by 'libgo.la'.  Stop.

Fixed like this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: lg.patch --]
[-- Type: text/x-patch, Size: 603 bytes --]

diff --git a/libgo/Makefile.am b/libgo/Makefile.am
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -1133,7 +1133,7 @@ if LIBGO_IS_BSD
 $(eval $(call PACKAGE_template,golang_org/x/net/route))
 
 golang_org_x_net_route_lo = \
-	golang_org/x/net/route/route.lo
+	golang_org/x/net/route.lo
 golang_org_x_net_route_check = \
 	golang_org/x/net/route/check
 
@@ -1146,7 +1146,7 @@ if LIBGO_IS_SOLARIS
 $(eval $(call PACKAGE_template,golang_org/x/net/lif))
 
 golang_org_x_net_lif_lo = \
-	golang_org/x/net/lif/lif.lo
+	golang_org/x/net/lif.lo
 golang_org_x_net_lif_check = \
 	golang_org/x/net/lif/check
 

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-15 18:08   ` Rainer Orth
@ 2017-01-16  1:05     ` Ian Lance Taylor
  0 siblings, 0 replies; 13+ messages in thread
From: Ian Lance Taylor @ 2017-01-16  1:05 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Andreas Schwab, gcc-patches, gofrontend-dev

On Sun, Jan 15, 2017 at 10:08 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> Andreas Schwab <schwab@linux-m68k.org> writes:
>
> Same on Solaris.  However, before I even get there, I hit
>
> make[4]: *** No rule to make target 'golang_org/x/net/lif/lif.lo', needed by 'libgo.la'.  Stop.
>
> Fixed like this:

Thanks.  Committed.

Ian

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-15 11:12 ` Andreas Schwab
  2017-01-15 18:08   ` Rainer Orth
@ 2017-01-16  1:21   ` Ian Lance Taylor
  2017-01-16 15:22     ` Rainer Orth
  1 sibling, 1 reply; 13+ messages in thread
From: Ian Lance Taylor @ 2017-01-16  1:21 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1820 bytes --]

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

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 3615 bytes --]

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-16  1:21   ` Ian Lance Taylor
@ 2017-01-16 15:22     ` Rainer Orth
  2017-01-16 16:21       ` Rainer Orth
  2017-01-18  3:56       ` Ian Lance Taylor
  0 siblings, 2 replies; 13+ messages in thread
From: Rainer Orth @ 2017-01-16 15:22 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Andreas Schwab, gcc-patches, gofrontend-dev

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

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-16 15:22     ` Rainer Orth
@ 2017-01-16 16:21       ` Rainer Orth
  2017-01-18  3:56       ` Ian Lance Taylor
  1 sibling, 0 replies; 13+ messages in thread
From: Rainer Orth @ 2017-01-16 16:21 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Andreas Schwab, gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 7624 bytes --]

Hi Ian,

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

I've made some progress here: I need to check <sys/sockio.h> for
SIOCGLIF* ioctls, and <net/if_types.h> for the IFT_* constants.  I've
updated configure.in and sysinfo.c accordingly, and adapted
defs_solaris.go as well.  However, I still run into a number of errors:

/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:29:22: error: reference to undefined identifier 'syscall._sockaddr_storage'
 type sockaddrStorage syscall._sockaddr_storage
                      ^

/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:32:36: error: reference to undefined identifier 'syscall.LIFC_NOXMIT'
  sysLIFC_NOXMIT          = syscall.LIFC_NOXMIT
                                    ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:33:36: error: reference to undefined identifier 'syscall.LIFC_EXTERNAL_SOURCE'
  sysLIFC_EXTERNAL_SOURCE = syscall.LIFC_EXTERNAL_SOURCE
                                    ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:34:36: error: reference to undefined identifier 'syscall.LIFC_TEMPORARY'
  sysLIFC_TEMPORARY       = syscall.LIFC_TEMPORARY
                                    ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:35:36: error: reference to undefined identifier 'syscall.LIFC_ALLZONES'
  sysLIFC_ALLZONES        = syscall.LIFC_ALLZONES
                                    ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:36:36: error: reference to undefined identifier 'syscall.LIFC_UNDER_IPMP'
  sysLIFC_UNDER_IPMP      = syscall.LIFC_UNDER_IPMP
                                    ^

The LIFC_* constants are only present in their _LIFC_* form in
sysinfo.go so far; need update to mksysinfo.sh.

/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:40:31: error: reference to undefined identifier 'syscall.SIOCGLIFADDR'
  sysSIOCGLIFADDR    = syscall.SIOCGLIFADDR
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:41:31: error: reference to undefined identifier 'syscall.SIOCGLIFDSTADDR'
  sysSIOCGLIFDSTADDR = syscall.SIOCGLIFDSTADDR
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:42:31: error: reference to undefined identifier 'syscall.SIOCGLIFFLAGS'
  sysSIOCGLIFFLAGS   = syscall.SIOCGLIFFLAGS
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:43:31: error: reference to undefined identifier 'syscall.SIOCGLIFMTU'
  sysSIOCGLIFMTU     = syscall.SIOCGLIFMTU
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:44:31: error: reference to undefined identifier 'syscall.SIOCGLIFNETMASK'
  sysSIOCGLIFNETMASK = syscall.SIOCGLIFNETMASK
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:45:31: error: reference to undefined identifier 'syscall.SIOCGLIFMETRIC'
  sysSIOCGLIFMETRIC  = syscall.SIOCGLIFMETRIC
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:46:31: error: reference to undefined identifier 'syscall.SIOCGLIFNUM'
  sysSIOCGLIFNUM     = syscall.SIOCGLIFNUM
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:47:31: error: reference to undefined identifier 'syscall.SIOCGLIFINDEX'
  sysSIOCGLIFINDEX   = syscall.SIOCGLIFINDEX
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:48:31: error: reference to undefined identifier 'syscall.SIOCGLIFSUBNET'
  sysSIOCGLIFSUBNET  = syscall.SIOCGLIFSUBNET
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:49:31: error: reference to undefined identifier 'syscall.SIOCGLIFLNKINFO'
  sysSIOCGLIFLNKINFO = syscall.SIOCGLIFLNKINFO
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:50:31: error: reference to undefined identifier 'syscall.SIOCGLIFCONF'
  sysSIOCGLIFCONF    = syscall.SIOCGLIFCONF
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:51:31: error: reference to undefined identifier 'syscall.SIOCGLIFHWADDR'
  sysSIOCGLIFHWADDR  = syscall.SIOCGLIFHWADDR
                               ^

All of them show as

// unknowndefine SIOCGLIFMTU _IOWR('i', 122, struct lifreq)

in gen-sysinfo.go.  Not sure what's going on here...

/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:73:31: error: invalid reference to unexported identifier 'syscall._sizeof_lifnum'
  sizeofLifnum       = syscall._sizeof_lifnum
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:74:31: error: invalid reference to unexported identifier 'syscall._sizeof_lifreq'
  sizeofLifreq       = syscall._sizeof_lifreq
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:75:31: error: invalid reference to unexported identifier 'syscall._sizeof_lifconf'
  sizeofLifconf      = syscall._sizeof_lifconf
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:76:31: error: invalid reference to unexported identifier 'syscall._sizeof_lif_ifinfo_req'
  sizeofLifIfinfoReq = syscall._sizeof_lif_ifinfo_req
                               ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:79:16: error: reference to undefined identifier 'syscall._lifnum'
 type sysLifnum syscall._lifnum
                ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:81:13: error: reference to undefined identifier 'syscall._lifreq'
 type lifreq syscall._lifreq
             ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:83:14: error: reference to undefined identifier 'syscall._lifconf'
 type lifconf syscall._lifconf
              ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:85:19: error: reference to undefined identifier 'syscall._lif_ifinfo_req'
 type lifIfinfoReq syscall._lif_ifinfo_req
                   ^

The structs aren't exported yet, need handling in mksysinfo.sh, too, I
believe.

/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:88:24: error: reference to undefined identifier 'syscall.IFT_IPV4'
  sysIFT_IPV4 = syscall.IFT_IPV4
                        ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:89:24: error: reference to undefined identifier 'syscall.IFT_IPV6'
  sysIFT_IPV6 = syscall.IFT_IPV6
                        ^
/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/defs_solaris.go:90:24: error: reference to undefined identifier 'syscall.IFT_6TO4'
  sysIFT_6TO4 = syscall.IFT_6TO4
                        ^

Need exporting: mksysinfo.sh handling for _IFT_ -> IFT_ transform.

/vol/gcc/src/hg/trunk/local/libgo/go/golang_org/x/net/lif/syscall.go:19:25: error: reference to undefined identifier 'syscall.Ioctl'
  _, _, errno := syscall.Ioctl(s, ioc, uintptr(arg))
                         ^

No idea what's wrong here...

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-libgo-lif.patch --]
[-- Type: text/x-patch, Size: 7322 bytes --]

diff --git a/libgo/configure.ac b/libgo/configure.ac
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -578,7 +578,7 @@ AC_C_BIGENDIAN
 
 GCC_CHECK_UNWIND_GETIPINFO
 
-AC_CHECK_HEADERS(port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
+AC_CHECK_HEADERS(port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h sys/sockio.h net/if_types.h)
 
 AC_CHECK_HEADERS([linux/filter.h linux/if_addr.h linux/if_ether.h linux/if_tun.h linux/netlink.h linux/rtnetlink.h], [], [],
 [#ifdef HAVE_SYS_SOCKET_H
diff --git a/libgo/go/golang_org/x/net/lif/defs_solaris.go b/libgo/go/golang_org/x/net/lif/defs_solaris.go
--- a/libgo/go/golang_org/x/net/lif/defs_solaris.go
+++ b/libgo/go/golang_org/x/net/lif/defs_solaris.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build ignore
+// +build solaris
 
 // +godefs map struct_in_addr [4]byte /* in_addr */
 // +godefs map struct_in6_addr [16]byte /* in6_addr */
@@ -16,75 +16,76 @@ package lif
 #include <net/if.h>
 #include <net/if_types.h>
 */
-import "C"
+import "syscall"
 
 const (
-	sysAF_UNSPEC = C.AF_UNSPEC
-	sysAF_INET   = C.AF_INET
-	sysAF_INET6  = C.AF_INET6
+	sysAF_UNSPEC = syscall.AF_UNSPEC
+	sysAF_INET   = syscall.AF_INET
+	sysAF_INET6  = syscall.AF_INET6
 
-	sysSOCK_DGRAM = C.SOCK_DGRAM
+	sysSOCK_DGRAM = syscall.SOCK_DGRAM
 )
 
-type sockaddrStorage C.struct_sockaddr_storage
+type sockaddrStorage syscall._sockaddr_storage
 
 const (
-	sysLIFC_NOXMIT          = C.LIFC_NOXMIT
-	sysLIFC_EXTERNAL_SOURCE = C.LIFC_EXTERNAL_SOURCE
-	sysLIFC_TEMPORARY       = C.LIFC_TEMPORARY
-	sysLIFC_ALLZONES        = C.LIFC_ALLZONES
-	sysLIFC_UNDER_IPMP      = C.LIFC_UNDER_IPMP
-	sysLIFC_ENABLED         = C.LIFC_ENABLED
+	sysLIFC_NOXMIT          = syscall.LIFC_NOXMIT
+	sysLIFC_EXTERNAL_SOURCE = syscall.LIFC_EXTERNAL_SOURCE
+	sysLIFC_TEMPORARY       = syscall.LIFC_TEMPORARY
+	sysLIFC_ALLZONES        = syscall.LIFC_ALLZONES
+	sysLIFC_UNDER_IPMP      = syscall.LIFC_UNDER_IPMP
+	// Not in Solaris 12, unused.
+	// sysLIFC_ENABLED      = syscall.LIFC_ENABLED
 
-	sysSIOCGLIFADDR    = C.SIOCGLIFADDR
-	sysSIOCGLIFDSTADDR = C.SIOCGLIFDSTADDR
-	sysSIOCGLIFFLAGS   = C.SIOCGLIFFLAGS
-	sysSIOCGLIFMTU     = C.SIOCGLIFMTU
-	sysSIOCGLIFNETMASK = C.SIOCGLIFNETMASK
-	sysSIOCGLIFMETRIC  = C.SIOCGLIFMETRIC
-	sysSIOCGLIFNUM     = C.SIOCGLIFNUM
-	sysSIOCGLIFINDEX   = C.SIOCGLIFINDEX
-	sysSIOCGLIFSUBNET  = C.SIOCGLIFSUBNET
-	sysSIOCGLIFLNKINFO = C.SIOCGLIFLNKINFO
-	sysSIOCGLIFCONF    = C.SIOCGLIFCONF
-	sysSIOCGLIFHWADDR  = C.SIOCGLIFHWADDR
+	sysSIOCGLIFADDR    = syscall.SIOCGLIFADDR
+	sysSIOCGLIFDSTADDR = syscall.SIOCGLIFDSTADDR
+	sysSIOCGLIFFLAGS   = syscall.SIOCGLIFFLAGS
+	sysSIOCGLIFMTU     = syscall.SIOCGLIFMTU
+	sysSIOCGLIFNETMASK = syscall.SIOCGLIFNETMASK
+	sysSIOCGLIFMETRIC  = syscall.SIOCGLIFMETRIC
+	sysSIOCGLIFNUM     = syscall.SIOCGLIFNUM
+	sysSIOCGLIFINDEX   = syscall.SIOCGLIFINDEX
+	sysSIOCGLIFSUBNET  = syscall.SIOCGLIFSUBNET
+	sysSIOCGLIFLNKINFO = syscall.SIOCGLIFLNKINFO
+	sysSIOCGLIFCONF    = syscall.SIOCGLIFCONF
+	sysSIOCGLIFHWADDR  = syscall.SIOCGLIFHWADDR
 )
 
 const (
-	sysIFF_UP          = C.IFF_UP
-	sysIFF_BROADCAST   = C.IFF_BROADCAST
-	sysIFF_DEBUG       = C.IFF_DEBUG
-	sysIFF_LOOPBACK    = C.IFF_LOOPBACK
-	sysIFF_POINTOPOINT = C.IFF_POINTOPOINT
-	sysIFF_NOTRAILERS  = C.IFF_NOTRAILERS
-	sysIFF_RUNNING     = C.IFF_RUNNING
-	sysIFF_NOARP       = C.IFF_NOARP
-	sysIFF_PROMISC     = C.IFF_PROMISC
-	sysIFF_ALLMULTI    = C.IFF_ALLMULTI
-	sysIFF_INTELLIGENT = C.IFF_INTELLIGENT
-	sysIFF_MULTICAST   = C.IFF_MULTICAST
-	sysIFF_MULTI_BCAST = C.IFF_MULTI_BCAST
-	sysIFF_UNNUMBERED  = C.IFF_UNNUMBERED
-	sysIFF_PRIVATE     = C.IFF_PRIVATE
+	sysIFF_UP          = syscall.IFF_UP
+	sysIFF_BROADCAST   = syscall.IFF_BROADCAST
+	sysIFF_DEBUG       = syscall.IFF_DEBUG
+	sysIFF_LOOPBACK    = syscall.IFF_LOOPBACK
+	sysIFF_POINTOPOINT = syscall.IFF_POINTOPOINT
+	sysIFF_NOTRAILERS  = syscall.IFF_NOTRAILERS
+	sysIFF_RUNNING     = syscall.IFF_RUNNING
+	sysIFF_NOARP       = syscall.IFF_NOARP
+	sysIFF_PROMISC     = syscall.IFF_PROMISC
+	sysIFF_ALLMULTI    = syscall.IFF_ALLMULTI
+	sysIFF_INTELLIGENT = syscall.IFF_INTELLIGENT
+	sysIFF_MULTICAST   = syscall.IFF_MULTICAST
+	sysIFF_MULTI_BCAST = syscall.IFF_MULTI_BCAST
+	sysIFF_UNNUMBERED  = syscall.IFF_UNNUMBERED
+	sysIFF_PRIVATE     = syscall.IFF_PRIVATE
 )
 
 const (
-	sizeofLifnum       = C.sizeof_struct_lifnum
-	sizeofLifreq       = C.sizeof_struct_lifreq
-	sizeofLifconf      = C.sizeof_struct_lifconf
-	sizeofLifIfinfoReq = C.sizeof_struct_lif_ifinfo_req
+	sizeofLifnum       = syscall._sizeof_lifnum
+	sizeofLifreq       = syscall._sizeof_lifreq
+	sizeofLifconf      = syscall._sizeof_lifconf
+	sizeofLifIfinfoReq = syscall._sizeof_lif_ifinfo_req
 )
 
-type sysLifnum C.struct_lifnum
+type sysLifnum syscall._lifnum
 
-type lifreq C.struct_lifreq
+type lifreq syscall._lifreq
 
-type lifconf C.struct_lifconf
+type lifconf syscall._lifconf
 
-type lifIfinfoReq C.struct_lif_ifinfo_req
+type lifIfinfoReq syscall._lif_ifinfo_req
 
 const (
-	sysIFT_IPV4 = C.IFT_IPV4
-	sysIFT_IPV6 = C.IFT_IPV6
-	sysIFT_6TO4 = C.IFT_6TO4
+	sysIFT_IPV4 = syscall.IFT_IPV4
+	sysIFT_IPV6 = syscall.IFT_IPV6
+	sysIFT_6TO4 = syscall.IFT_6TO4
 )
diff --git a/libgo/go/golang_org/x/net/lif/syscall.go b/libgo/go/golang_org/x/net/lif/syscall.go
--- a/libgo/go/golang_org/x/net/lif/syscall.go
+++ b/libgo/go/golang_org/x/net/lif/syscall.go
@@ -11,20 +11,12 @@ import (
 	"unsafe"
 )
 
-//go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
-
-//go:linkname procIoctl libc_ioctl
-
-var procIoctl uintptr
-
-func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, uintptr, syscall.Errno)
-
 // TODO: replace with runtime.KeepAlive when available
 //go:noescape
 func keepAlive(p unsafe.Pointer)
 
 func ioctl(s, ioc uintptr, arg unsafe.Pointer) error {
-	_, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procIoctl)), 3, s, ioc, uintptr(arg), 0, 0, 0)
+	_, _, errno := syscall.Ioctl(s, ioc, uintptr(arg))
 	keepAlive(arg)
 	if errno != 0 {
 		return error(errno)
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -82,6 +82,9 @@
 #if defined(HAVE_SYS_SELECT_H)
 #include <sys/select.h>
 #endif
+#if defined(HAVE_SYS_SOCKIO_H)
+#include <sys/sockio.h>
+#endif
 #include <time.h>
 #include <unistd.h>
 #include <netdb.h>
@@ -111,6 +114,9 @@
 #if defined(HAVE_NET_IF_ARP_H)
 #include <net/if_arp.h>
 #endif
+#if defined(HAVE_NET_IF_TYPES_H)
+#include <net/if_types.h>
+#endif
 #if defined(HAVE_NET_ROUTE_H)
 #include <net/route.h>
 #endif

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-14  0:06 libgo patch committed: Update to Go1.8rc1 Ian Lance Taylor
  2017-01-15 11:12 ` Andreas Schwab
@ 2017-01-17 16:10 ` Lynn A. Boger
  2017-01-17 16:12   ` Jakub Jelinek
  1 sibling, 1 reply; 13+ messages in thread
From: Lynn A. Boger @ 2017-01-17 16:10 UTC (permalink / raw)
  To: Ian Lance Taylor, gcc-patches, gofrontend-dev

I think this is missing the update of the libgo version number.

- Lynn

On 01/13/2017 06:05 PM, Ian Lance Taylor wrote:
> I committed a patch to libgo to update the library to the first
> release candidate of the upcoming Go 1.8 release.  This is a big
> update, mostly a straight copy of the code in the master Go library.
>
> I made the following changes to the Go frontend to correspond to
> changes in the runtime library:
>
> * Change map assignment to use mapassign and assign value directly.
> * Change string iteration to use decoderune, faster for ASCII strings.
> * Change makeslice to take int, and use makeslice64 for larger values.
> * Add new noverflow field to hmap struct used for maps.
>
> There are two known problems that I simply commented out of test code
> until they can be fixed:
>
> * Commented out test in go/types/sizes_test.go that doesn't compile.
> * Commented out reflect.TestStructOf test for padding after zero-sized field.
>
> As usual with these sorts of updates the patch is too large to send to
> the mailing list.  I've appended the changes to the gccgo-specific
> parts of the code.
>
> Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  I would not
> be terribly surprised if this breaks Solaris.  I'll try to check that
> out shortly.
>
> Ian
>
> gotools/ChangeLog:
>
> 2017-01-13  Ian Lance Taylor  <iant@golang.org>
>
> Updates for Go 1.8rc1.
> * Makefile.am (go_cmd_go_files): Add bug.go.
> (s-zdefaultcc): Write defaultPkgConfig.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-17 16:10 ` Lynn A. Boger
@ 2017-01-17 16:12   ` Jakub Jelinek
  2017-01-17 16:47     ` Lynn A. Boger
  0 siblings, 1 reply; 13+ messages in thread
From: Jakub Jelinek @ 2017-01-17 16:12 UTC (permalink / raw)
  To: Lynn A. Boger; +Cc: Ian Lance Taylor, gcc-patches, gofrontend-dev

On Tue, Jan 17, 2017 at 10:03:25AM -0600, Lynn A. Boger wrote:
> I think this is missing the update of the libgo version number.

Why?  GCC 6.x shipped with libgo.so.9, so I don't see anything wrong
on 7.x shipping libgo.so.10.

	Jakub

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-17 16:12   ` Jakub Jelinek
@ 2017-01-17 16:47     ` Lynn A. Boger
  2017-01-23 18:15       ` Ian Lance Taylor
  0 siblings, 1 reply; 13+ messages in thread
From: Lynn A. Boger @ 2017-01-17 16:47 UTC (permalink / raw)
  To: gcc-patches

In the past, the libgo version number has always matched the Go version, 
not the gcc release.

The libgo for Go 1.7 and Go 1.8 are not the same.  If someone wanted to 
build gccgo for Go 1.7 using an old commit

maybe for testing or comparison purposes, the libgo version would not 
identify which one it was because

libgo.so.10 could be either Go 1.7 or 1.8.  Maybe nobody cares about 
doing that. It's not a huge deal to me but

it would be a point of confusion.

GCC 6.x was Go 1.6.

On 01/17/2017 10:09 AM, Jakub Jelinek wrote:
> On Tue, Jan 17, 2017 at 10:03:25AM -0600, Lynn A. Boger wrote:
>> I think this is missing the update of the libgo version number.
> Why?  GCC 6.x shipped with libgo.so.9, so I don't see anything wrong
> on 7.x shipping libgo.so.10.
>
> 	Jakub
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-16 15:22     ` Rainer Orth
  2017-01-16 16:21       ` Rainer Orth
@ 2017-01-18  3:56       ` Ian Lance Taylor
  2017-01-19 15:53         ` Rainer Orth
  1 sibling, 1 reply; 13+ messages in thread
From: Ian Lance Taylor @ 2017-01-18  3:56 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Andreas Schwab, gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

On Mon, Jan 16, 2017 at 7:21 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
>
> I'm getting further on Solaris now, but the build still fails:

I committed this patch to fix the remaining build problems on Solaris.
Bootstrapped and ran some of the Go tests on i386-sun-solaris11 and
x86_64-pc-linux-gnu.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 6081 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 244484)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@
-223cba75b947afc1ee5a13a60c15c66f6ff355c1
+2b3d389f961b8461b3fdf42318a628f68b56f8b1
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/golang_org/x/net/lif/link.go
===================================================================
--- libgo/go/golang_org/x/net/lif/link.go	(revision 244456)
+++ libgo/go/golang_org/x/net/lif/link.go	(working copy)
@@ -84,7 +84,7 @@ func links(eps []endpoint, name string)
 		b := make([]byte, lifn.Count*sizeofLifreq)
 		lifc.Family = uint16(ep.af)
 		lifc.Len = lifn.Count * sizeofLifreq
-		littleEndian.PutUint64(lifc.Lifcu[:], uint64(uintptr(unsafe.Pointer(&b[0]))))
+		lifc.Lifcu = unsafe.Pointer(&b[0])
 		ioc = int64(sysSIOCGLIFCONF)
 		if err := ioctl(ep.s, uintptr(ioc), unsafe.Pointer(&lifc)); err != nil {
 			continue
Index: libgo/go/golang_org/x/net/lif/syscall.go
===================================================================
--- libgo/go/golang_org/x/net/lif/syscall.go	(revision 244456)
+++ libgo/go/golang_org/x/net/lif/syscall.go	(working copy)
@@ -11,23 +11,12 @@ import (
 	"unsafe"
 )
 
-//go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
-
-//go:linkname procIoctl libc_ioctl
-
-var procIoctl uintptr
-
-func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, uintptr, syscall.Errno)
-
-// TODO: replace with runtime.KeepAlive when available
-//go:noescape
-func keepAlive(p unsafe.Pointer)
+//extern __go_ioctl_ptr
+func libc_ioctl(int32, int32, unsafe.Pointer) int32
 
 func ioctl(s, ioc uintptr, arg unsafe.Pointer) error {
-	_, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procIoctl)), 3, s, ioc, uintptr(arg), 0, 0, 0)
-	keepAlive(arg)
-	if errno != 0 {
-		return error(errno)
+	if libc_ioctl(int32(s), int32(ioc), arg) < 0 {
+		return syscall.GetErrno()
 	}
 	return nil
 }
Index: libgo/go/golang_org/x/net/lif/zsys_solaris.go
===================================================================
--- libgo/go/golang_org/x/net/lif/zsys_solaris.go	(revision 244456)
+++ libgo/go/golang_org/x/net/lif/zsys_solaris.go	(working copy)
@@ -3,6 +3,8 @@
 
 package lif
 
+import "unsafe"
+
 const (
 	sysAF_UNSPEC = 0x0
 	sysAF_INET   = 0x2
@@ -59,15 +61,11 @@ const (
 )
 
 const (
-	sizeofLifnum       = 0xc
 	sizeofLifreq       = 0x178
-	sizeofLifconf      = 0x18
-	sizeofLifIfinfoReq = 0x10
 )
 
 type sysLifnum struct {
 	Family    uint16
-	Pad_cgo_0 [2]byte
 	Flags     int32
 	Count     int32
 }
@@ -81,16 +79,13 @@ type lifreq struct {
 
 type lifconf struct {
 	Family    uint16
-	Pad_cgo_0 [2]byte
 	Flags     int32
 	Len       int32
-	Pad_cgo_1 [4]byte
-	Lifcu     [8]byte
+	Lifcu     unsafe.Pointer
 }
 
 type lifIfinfoReq struct {
 	Maxhops      uint8
-	Pad_cgo_0    [3]byte
 	Reachtime    uint32
 	Reachretrans uint32
 	Maxmtu       uint32
Index: libgo/go/golang_org/x/net/lif/zsys_solaris_amd64.go
===================================================================
--- libgo/go/golang_org/x/net/lif/zsys_solaris_amd64.go	(revision 244166)
+++ libgo/go/golang_org/x/net/lif/zsys_solaris_amd64.go	(working copy)
@@ -1,103 +0,0 @@
-// Created by cgo -godefs - DO NOT EDIT
-// cgo -godefs defs_solaris.go
-
-package lif
-
-const (
-	sysAF_UNSPEC = 0x0
-	sysAF_INET   = 0x2
-	sysAF_INET6  = 0x1a
-
-	sysSOCK_DGRAM = 0x1
-)
-
-type sockaddrStorage struct {
-	Family     uint16
-	X_ss_pad1  [6]int8
-	X_ss_align float64
-	X_ss_pad2  [240]int8
-}
-
-const (
-	sysLIFC_NOXMIT          = 0x1
-	sysLIFC_EXTERNAL_SOURCE = 0x2
-	sysLIFC_TEMPORARY       = 0x4
-	sysLIFC_ALLZONES        = 0x8
-	sysLIFC_UNDER_IPMP      = 0x10
-	sysLIFC_ENABLED         = 0x20
-
-	sysSIOCGLIFADDR    = -0x3f87968f
-	sysSIOCGLIFDSTADDR = -0x3f87968d
-	sysSIOCGLIFFLAGS   = -0x3f87968b
-	sysSIOCGLIFMTU     = -0x3f879686
-	sysSIOCGLIFNETMASK = -0x3f879683
-	sysSIOCGLIFMETRIC  = -0x3f879681
-	sysSIOCGLIFNUM     = -0x3ff3967e
-	sysSIOCGLIFINDEX   = -0x3f87967b
-	sysSIOCGLIFSUBNET  = -0x3f879676
-	sysSIOCGLIFLNKINFO = -0x3f879674
-	sysSIOCGLIFCONF    = -0x3fef965b
-	sysSIOCGLIFHWADDR  = -0x3f879640
-)
-
-const (
-	sysIFF_UP          = 0x1
-	sysIFF_BROADCAST   = 0x2
-	sysIFF_DEBUG       = 0x4
-	sysIFF_LOOPBACK    = 0x8
-	sysIFF_POINTOPOINT = 0x10
-	sysIFF_NOTRAILERS  = 0x20
-	sysIFF_RUNNING     = 0x40
-	sysIFF_NOARP       = 0x80
-	sysIFF_PROMISC     = 0x100
-	sysIFF_ALLMULTI    = 0x200
-	sysIFF_INTELLIGENT = 0x400
-	sysIFF_MULTICAST   = 0x800
-	sysIFF_MULTI_BCAST = 0x1000
-	sysIFF_UNNUMBERED  = 0x2000
-	sysIFF_PRIVATE     = 0x8000
-)
-
-const (
-	sizeofLifnum       = 0xc
-	sizeofLifreq       = 0x178
-	sizeofLifconf      = 0x18
-	sizeofLifIfinfoReq = 0x10
-)
-
-type sysLifnum struct {
-	Family    uint16
-	Pad_cgo_0 [2]byte
-	Flags     int32
-	Count     int32
-}
-
-type lifreq struct {
-	Name   [32]int8
-	Lifru1 [4]byte
-	Type   uint32
-	Lifru  [336]byte
-}
-
-type lifconf struct {
-	Family    uint16
-	Pad_cgo_0 [2]byte
-	Flags     int32
-	Len       int32
-	Pad_cgo_1 [4]byte
-	Lifcu     [8]byte
-}
-
-type lifIfinfoReq struct {
-	Maxhops      uint8
-	Pad_cgo_0    [3]byte
-	Reachtime    uint32
-	Reachretrans uint32
-	Maxmtu       uint32
-}
-
-const (
-	sysIFT_IPV4 = 0xc8
-	sysIFT_IPV6 = 0xc9
-	sysIFT_6TO4 = 0xca
-)
Index: libgo/go/syscall/syscall_solaris.go
===================================================================
--- libgo/go/syscall/syscall_solaris.go	(revision 244456)
+++ libgo/go/syscall/syscall_solaris.go	(working copy)
@@ -29,3 +29,20 @@ func direntNamlen(buf []byte) (uint64, b
 	}
 	return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true
 }
+
+//sysnb getexecname() (execname unsafe.Pointer, err error)
+//getexecname() *byte
+
+func Getexecname() (path string, err error) {
+	ptr, err := getexecname()
+	if err != nil {
+		return "", err
+	}
+	bytes := (*[1 << 29]byte)(ptr)[:]
+	for i, b := range bytes {
+		if b == 0 {
+			return string(bytes[:i]), nil
+		}
+	}
+	panic("unreachable")
+}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-18  3:56       ` Ian Lance Taylor
@ 2017-01-19 15:53         ` Rainer Orth
  0 siblings, 0 replies; 13+ messages in thread
From: Rainer Orth @ 2017-01-19 15:53 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Andreas Schwab, gcc-patches, gofrontend-dev

Hi Ian,

> On Mon, Jan 16, 2017 at 7:21 AM, Rainer Orth
> <ro@cebitec.uni-bielefeld.de> wrote:
>>
>> I'm getting further on Solaris now, but the build still fails:
>
> I committed this patch to fix the remaining build problems on Solaris.
> Bootstrapped and ran some of the Go tests on i386-sun-solaris11 and
> x86_64-pc-linux-gnu.

worked fine, thanks.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgo patch committed: Update to Go1.8rc1
  2017-01-17 16:47     ` Lynn A. Boger
@ 2017-01-23 18:15       ` Ian Lance Taylor
  0 siblings, 0 replies; 13+ messages in thread
From: Ian Lance Taylor @ 2017-01-23 18:15 UTC (permalink / raw)
  To: Lynn A. Boger; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

On Tue, Jan 17, 2017 at 8:44 AM, Lynn A. Boger
<laboger@linux.vnet.ibm.com> wrote:
> In the past, the libgo version number has always matched the Go version, not
> the gcc release.
>
> The libgo for Go 1.7 and Go 1.8 are not the same.  If someone wanted to
> build gccgo for Go 1.7 using an old commit
>
> maybe for testing or comparison purposes, the libgo version would not
> identify which one it was because
>
> libgo.so.10 could be either Go 1.7 or 1.8.  Maybe nobody cares about doing
> that. It's not a huge deal to me but
>
> it would be a point of confusion.
>
> GCC 6.x was Go 1.6.

I do usually update the version number for each major import (and I do
usually forget to do it the first time around).  I committed this
patch to mainline.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 801 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 244733)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@
-b573d4756096523d8bd4bf7b11e56383e5a2cca4
+6d8ef03e760ff737ff2c613642142290b0f02e0e
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/configure.ac
===================================================================
--- libgo/configure.ac	(revision 244166)
+++ libgo/configure.ac	(working copy)
@@ -11,7 +11,7 @@ AC_INIT(package-unused, version-unused,,
 AC_CONFIG_SRCDIR(Makefile.am)
 AC_CONFIG_HEADER(config.h)
 
-libtool_VERSION=10:0:0
+libtool_VERSION=11:0:0
 AC_SUBST(libtool_VERSION)
 
 AM_ENABLE_MULTILIB(, ..)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-01-23 18:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-14  0:06 libgo patch committed: Update to Go1.8rc1 Ian Lance Taylor
2017-01-15 11:12 ` Andreas Schwab
2017-01-15 18:08   ` Rainer Orth
2017-01-16  1:05     ` Ian Lance Taylor
2017-01-16  1:21   ` Ian Lance Taylor
2017-01-16 15:22     ` Rainer Orth
2017-01-16 16:21       ` Rainer Orth
2017-01-18  3:56       ` Ian Lance Taylor
2017-01-19 15:53         ` Rainer Orth
2017-01-17 16:10 ` Lynn A. Boger
2017-01-17 16:12   ` Jakub Jelinek
2017-01-17 16:47     ` Lynn A. Boger
2017-01-23 18:15       ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).