Patchwork libgo patch committed: Update to current Go library

login
register
mail settings
Submitter Rainer Orth
Date Oct. 25, 2012, 9:36 a.m.
Message ID <yddr4om7v1z.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/194087/
State New
Headers show

Comments

Rainer Orth - Oct. 25, 2012, 9:36 a.m.
Ian Lance Taylor <iant@google.com> writes:

> There is a decent change that this will break something on non-x86
> systems.  I will do what testing I am able to do after the commit.

As expected, it did break the Solaris libgo build:

* udpsock_posix.go lacked definitions of joinIPv4Group, joinIPv6Group,
  setIPv6MulticastInterface, setIPv6MulticastLoopback.  It turned out
  that sockoptip_solaris.go isn't needed any longer, but
  sockoptip_posix.go can be used instead.

* Solaris lacked some stat_atim*.go in go/archive/tar initially.  With
  stat_atim.go used, it didn't build initially.  Since Stat_t.[AC]tim
  are Timestruc, we need a corresponding Unix(), now provided in
  syscall_solaris.go.

With those changes, libgo builds again, and Solaris/x86 testsuite
results are reasonable:

FAIL: net

--- FAIL: TestMulticastListener (0.03 seconds)
multicast_posix_test.go:72:     "224.0.0.254:12345" not found in RIB

FAIL: syscall

creds_test.go:22:41: error: reference to undefined identifier 'syscall.AF_LOCAL'
  fds, err := syscall.Socketpair(syscall.AF_LOCAL, syscall.SOCK_STREAM, 0)
                                         ^
creds_test.go:29:66: error: reference to undefined identifier 'syscall.SO_PASSCRED'
  err = syscall.SetsockoptInt(fds[0], syscall.SOL_SOCKET, syscall.SO_PASSCRED, 1)
                                                                  ^
creds_test.go:48:12: error: reference to undefined identifier 'syscall.Ucred'
  var ucred syscall.Ucred
            ^
creds_test.go:53:18: error: reference to undefined identifier 'syscall.UnixCredentials'
   oob := syscall.UnixCredentials(&ucred)
                  ^
creds_test.go:63:17: error: reference to undefined identifier 'syscall.UnixCredentials'
  oob := syscall.UnixCredentials(&ucred)
                 ^
creds_test.go:102:27: error: reference to undefined identifier 'syscall.ParseUnixCredentials'
  newUcred, err := syscall.ParseUnixCredentials(&scm[0])
                           ^
passfd_test.go:40:41: error: reference to undefined identifier 'syscall.AF_LOCAL'
  fds, err := syscall.Socketpair(syscall.AF_LOCAL, syscall.SOCK_STREAM, 0)
                                         ^

Needs some porting work, it seems.

FAIL: net/http

unexpected fault address unexpected fault address 0x7f079d14be59unexpected fault address 0x7ffffd140410
0x7f079bb4bed9unexpected fault address unexpected fault address Illegal Instruction

0x7ffffd140410
0x7f079d54be59



goroutine 1 [chan receive]:
main.main
        /var/gcc/regression/trunk/10-gcc/build/i386-pc-solaris2.10/amd64/libgo/gotest29238/test/_testmain.go:159

and many more goroutine stacks...

FAIL: runtime/pprof

Reported as PR go/54873 already.

On the other hand, many Solaris/SPARC tests are failing:

unexpected fault address 0xfcb70dec
throw: fault
[signal 0xa code=0x1 addr=0xfcb70dec]

goroutine 4 [running]:
unexpected fault address 0xfcb71864
panic during panic
FAIL: log

Still have to investigate what's going on.

	Rainer


2012-10-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* Makefile.am [LIBGO_IS_SOLARIS] (go_net_sockoptip_file): Replace
	go/net/sockoptip_solaris.go by go/net/sockoptip_posix.go.
	[LIBGO_IS_SOLARIS] (archive_tar_atim_file): Use
	go/archive/tar/stat_atim.go.
	* Makefile.in: Regenerate.
	* go/net/sockoptip_solaris.go: Remove.
	* go/syscall/syscall_solaris.go: New file.
Ian Taylor - Oct. 25, 2012, 6:26 p.m.
On Thu, Oct 25, 2012 at 2:36 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> Ian Lance Taylor <iant@google.com> writes:
>
>> There is a decent change that this will break something on non-x86
>> systems.  I will do what testing I am able to do after the commit.
>
> As expected, it did break the Solaris libgo build:
>
> * udpsock_posix.go lacked definitions of joinIPv4Group, joinIPv6Group,
>   setIPv6MulticastInterface, setIPv6MulticastLoopback.  It turned out
>   that sockoptip_solaris.go isn't needed any longer, but
>   sockoptip_posix.go can be used instead.
>
> * Solaris lacked some stat_atim*.go in go/archive/tar initially.  With
>   stat_atim.go used, it didn't build initially.  Since Stat_t.[AC]tim
>   are Timestruc, we need a corresponding Unix(), now provided in
>   syscall_solaris.go.
>
> With those changes, libgo builds again, and Solaris/x86 testsuite
> results are reasonable:

Thanks.  I committed your patch to mainline.

Ian

Patch

# HG changeset patch
# Parent e8a7c94c7461ab7d5fc572468b69feddbb338069
Restore Solaris bootstrap

diff --git a/libgo/Makefile.am b/libgo/Makefile.am
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -704,7 +704,7 @@  if LIBGO_IS_SOLARIS
 go_net_cgo_file = go/net/cgo_linux.go
 go_net_sock_file = go/net/sock_solaris.go
 go_net_sockopt_file = go/net/sockopt_bsd.go
-go_net_sockoptip_file = go/net/sockoptip_bsd.go go/net/sockoptip_solaris.go
+go_net_sockoptip_file = go/net/sockoptip_bsd.go go/net/sockoptip_posix.go
 else
 if LIBGO_IS_FREEBSD
 go_net_cgo_file = go/net/cgo_bsd.go
@@ -968,6 +968,9 @@  endif
 if LIBGO_IS_OPENBSD
 archive_tar_atim_file = go/archive/tar/stat_atim.go
 endif
+if LIBGO_IS_SOLARIS
+archive_tar_atim_file = go/archive/tar/stat_atim.go
+endif
 if LIBGO_IS_DARWIN
 archive_tar_atim_file = go/archive/tar/stat_atimespec.go
 endif
diff --git a/libgo/go/syscall/syscall_solaris.go b/libgo/go/syscall/syscall_solaris.go
new file mode 100644
--- /dev/null
+++ b/libgo/go/syscall/syscall_solaris.go
@@ -0,0 +1,13 @@ 
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package syscall
+
+func (ts *Timestruc) Unix() (sec int64, nsec int64) {
+	return int64(ts.Sec), int64(ts.Nsec)
+}
+
+func (ts *Timestruc) Nano() int64 {
+	return int64(ts.Sec)*1e9 + int64(ts.Nsec)
+}