aboutsummaryrefslogtreecommitdiff
path: root/libgo/go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-02-16 11:30:04 -0800
committerIan Lance Taylor <iant@golang.org>2022-02-16 12:20:10 -0800
commit24ca97325cab7bc454c785d55f37120fe7ea6f74 (patch)
tree0dff7e34fe65a75ba82e4a13d69991fdaea7c5eb /libgo/go
parent6d66bd25dc84e362f56ffe66667f6c9017ba73d0 (diff)
downloadgcc-24ca97325cab7bc454c785d55f37120fe7ea6f74.zip
gcc-24ca97325cab7bc454c785d55f37120fe7ea6f74.tar.gz
gcc-24ca97325cab7bc454c785d55f37120fe7ea6f74.tar.bz2
libgo: restore building on Solaris
Add build tags and a few other changes so that libgo builds on Solaris. Patch partially from Rainer Orth. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/386215
Diffstat (limited to 'libgo/go')
-rw-r--r--libgo/go/net/fcntl_libc_test.go5
-rw-r--r--libgo/go/os/signal/internal/pty/pty.go2
-rw-r--r--libgo/go/runtime/os3_solaris.go8
-rw-r--r--libgo/go/runtime/stubs2.go2
-rw-r--r--libgo/go/syscall/exec_bsd.go4
-rw-r--r--libgo/go/syscall/export_unix_test.go2
-rw-r--r--libgo/go/syscall/syscall_solaris.go2
7 files changed, 17 insertions, 8 deletions
diff --git a/libgo/go/net/fcntl_libc_test.go b/libgo/go/net/fcntl_libc_test.go
index f59a1aa..c935c45 100644
--- a/libgo/go/net/fcntl_libc_test.go
+++ b/libgo/go/net/fcntl_libc_test.go
@@ -6,7 +6,10 @@
package net
-import "syscall"
+import (
+ "syscall"
+ _ "unsafe"
+)
// Use a helper function to call fcntl. This is defined in C in
// libgo/runtime.
diff --git a/libgo/go/os/signal/internal/pty/pty.go b/libgo/go/os/signal/internal/pty/pty.go
index e5ee3f6..01c3908 100644
--- a/libgo/go/os/signal/internal/pty/pty.go
+++ b/libgo/go/os/signal/internal/pty/pty.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.
-//go:build (aix || darwin || dragonfly || freebsd || hurd || (linux && !android) || netbsd || openbsd) && cgo
+//go:build (aix || darwin || dragonfly || freebsd || hurd || (linux && !android) || netbsd || openbsd || solaris) && cgo
// Package pty is a simple pseudo-terminal package for Unix systems,
// implemented by calling C functions via cgo.
diff --git a/libgo/go/runtime/os3_solaris.go b/libgo/go/runtime/os3_solaris.go
index ec23ce2..6c82574 100644
--- a/libgo/go/runtime/os3_solaris.go
+++ b/libgo/go/runtime/os3_solaris.go
@@ -36,6 +36,14 @@ func solarisExecutablePath() string {
return executablePath
}
+func setProcessCPUProfiler(hz int32) {
+ setProcessCPUProfilerTimer(hz)
+}
+
+func setThreadCPUProfiler(hz int32) {
+ setThreadCPUProfilerHz(hz)
+}
+
//go:nosplit
func validSIGPROF(mp *m, c *sigctxt) bool {
return true
diff --git a/libgo/go/runtime/stubs2.go b/libgo/go/runtime/stubs2.go
index 0b9e605..5871092 100644
--- a/libgo/go/runtime/stubs2.go
+++ b/libgo/go/runtime/stubs2.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.
-//go:build !aix && !darwin && !js && !openbsd && !plan9 && !solaris && !windows
+//go:build !js && !plan9 && !windows
package runtime
diff --git a/libgo/go/syscall/exec_bsd.go b/libgo/go/syscall/exec_bsd.go
index c05ae13..ff88bc4 100644
--- a/libgo/go/syscall/exec_bsd.go
+++ b/libgo/go/syscall/exec_bsd.go
@@ -143,13 +143,13 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
// User and groups
if cred := sys.Credential; cred != nil {
ngroups := len(cred.Groups)
- var groups *Gid_t
+ var groups unsafe.Pointer
if ngroups > 0 {
gids := make([]Gid_t, ngroups)
for i, v := range cred.Groups {
gids[i] = Gid_t(v)
}
- groups = &gids[0]
+ groups = unsafe.Pointer(&gids[0])
}
if !cred.NoSetGroups {
err1 = raw_setgroups(ngroups, groups)
diff --git a/libgo/go/syscall/export_unix_test.go b/libgo/go/syscall/export_unix_test.go
index 184eb84..bd904c7 100644
--- a/libgo/go/syscall/export_unix_test.go
+++ b/libgo/go/syscall/export_unix_test.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.
-//go:build dragonfly || freebsd || hurd || linux || netbsd || openbsd
+//go:build dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
package syscall
diff --git a/libgo/go/syscall/syscall_solaris.go b/libgo/go/syscall/syscall_solaris.go
index 13c60a4..673ba82 100644
--- a/libgo/go/syscall/syscall_solaris.go
+++ b/libgo/go/syscall/syscall_solaris.go
@@ -6,8 +6,6 @@ package syscall
import "unsafe"
-const _F_DUP2FD_CLOEXEC = F_DUP2FD_CLOEXEC
-
func (ts *Timestruc) Unix() (sec int64, nsec int64) {
return int64(ts.Sec), int64(ts.Nsec)
}