diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-01-21 23:05:52 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-01-21 23:05:52 +0000 |
commit | ea31c98daba7d3459dc5500049876fe0a71a89d3 (patch) | |
tree | 9dc7ee584a37d93ea00455a5ec27d75fa464bf58 /libgo/go | |
parent | a9647bf912b9d2eeb9297bb96d5274eb8c9ed75c (diff) | |
download | gcc-ea31c98daba7d3459dc5500049876fe0a71a89d3.zip gcc-ea31c98daba7d3459dc5500049876fe0a71a89d3.tar.gz gcc-ea31c98daba7d3459dc5500049876fe0a71a89d3.tar.bz2 |
libgo: fix building, and some testing, on Solaris
Restore some of the fixes that were applied to golang_org/x/net/lif
but were lost when 1.12 moved the directory to internal/x/net/lif.
Add support for reading /proc to fetch argc/argv/env for c-archive mode.
Reviewed-on: https://go-review.googlesource.com/c/158640
From-SVN: r268130
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/internal/x/net/lif/syscall.go | 14 | ||||
-rw-r--r-- | libgo/go/internal/x/net/lif/zsys_solaris.go (renamed from libgo/go/internal/x/net/lif/zsys_solaris_amd64.go) | 8 | ||||
-rw-r--r-- | libgo/go/runtime/signal_unix.go | 5 |
3 files changed, 11 insertions, 16 deletions
diff --git a/libgo/go/internal/x/net/lif/syscall.go b/libgo/go/internal/x/net/lif/syscall.go index aadab2e..ea75414 100644 --- a/libgo/go/internal/x/net/lif/syscall.go +++ b/libgo/go/internal/x/net/lif/syscall.go @@ -11,18 +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) +//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) - if errno != 0 { - return error(errno) + if libc_ioctl(int32(s), int32(ioc), arg) < 0 { + return syscall.GetErrno() } return nil } diff --git a/libgo/go/internal/x/net/lif/zsys_solaris_amd64.go b/libgo/go/internal/x/net/lif/zsys_solaris.go index b5e999b..0d9ed2f 100644 --- a/libgo/go/internal/x/net/lif/zsys_solaris_amd64.go +++ b/libgo/go/internal/x/net/lif/zsys_solaris.go @@ -3,6 +3,8 @@ package lif +import "unsafe" + const ( sysAF_UNSPEC = 0x0 sysAF_INET = 0x2 @@ -67,7 +69,6 @@ const ( type lifnum struct { Family uint16 - Pad_cgo_0 [2]byte Flags int32 Count int32 } @@ -81,16 +82,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.Sizeof(unsafe.Pointer(nil))]byte } type lifIfinfoReq struct { Maxhops uint8 - Pad_cgo_0 [3]byte Reachtime uint32 Reachretrans uint32 Maxmtu uint32 diff --git a/libgo/go/runtime/signal_unix.go b/libgo/go/runtime/signal_unix.go index 0a2cf72..2f89c7c 100644 --- a/libgo/go/runtime/signal_unix.go +++ b/libgo/go/runtime/signal_unix.go @@ -441,7 +441,10 @@ func raisebadsignal(sig uint32, c *sigctxt) { // // On FreeBSD, the libthr sigaction code prevents // this from working so we fall through to raise. - if GOOS != "freebsd" && (isarchive || islibrary) && handler == _SIG_DFL && c.sigcode() != _SI_USER { + // + // The argument above doesn't hold for SIGPIPE, which won't + // necessarily be re-raised if we return. + if GOOS != "freebsd" && (isarchive || islibrary) && handler == _SIG_DFL && c.sigcode() != _SI_USER && sig != _SIGPIPE { return } |