| 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
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) +}