Skip to content
Snippets Groups Projects
Commit 24ca9732 authored by Ian Lance Taylor's avatar Ian Lance Taylor
Browse files

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
parent 6d66bd25
No related branches found
No related tags found
No related merge requests found
0af68c0552341a44f1fb12301f9eff954b9dde88 3742e8a154bfec805054b4ebf0809f12dc7694da
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
package net package net
import "syscall" import (
"syscall"
_ "unsafe"
)
// Use a helper function to call fcntl. This is defined in C in // Use a helper function to call fcntl. This is defined in C in
// libgo/runtime. // libgo/runtime.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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, // Package pty is a simple pseudo-terminal package for Unix systems,
// implemented by calling C functions via cgo. // implemented by calling C functions via cgo.
......
...@@ -36,6 +36,14 @@ func solarisExecutablePath() string { ...@@ -36,6 +36,14 @@ func solarisExecutablePath() string {
return executablePath return executablePath
} }
func setProcessCPUProfiler(hz int32) {
setProcessCPUProfilerTimer(hz)
}
func setThreadCPUProfiler(hz int32) {
setThreadCPUProfilerHz(hz)
}
//go:nosplit //go:nosplit
func validSIGPROF(mp *m, c *sigctxt) bool { func validSIGPROF(mp *m, c *sigctxt) bool {
return true return true
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 package runtime
......
...@@ -143,13 +143,13 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr ...@@ -143,13 +143,13 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
// User and groups // User and groups
if cred := sys.Credential; cred != nil { if cred := sys.Credential; cred != nil {
ngroups := len(cred.Groups) ngroups := len(cred.Groups)
var groups *Gid_t var groups unsafe.Pointer
if ngroups > 0 { if ngroups > 0 {
gids := make([]Gid_t, ngroups) gids := make([]Gid_t, ngroups)
for i, v := range cred.Groups { for i, v := range cred.Groups {
gids[i] = Gid_t(v) gids[i] = Gid_t(v)
} }
groups = &gids[0] groups = unsafe.Pointer(&gids[0])
} }
if !cred.NoSetGroups { if !cred.NoSetGroups {
err1 = raw_setgroups(ngroups, groups) err1 = raw_setgroups(ngroups, groups)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 package syscall
......
...@@ -6,8 +6,6 @@ package syscall ...@@ -6,8 +6,6 @@ package syscall
import "unsafe" import "unsafe"
const _F_DUP2FD_CLOEXEC = F_DUP2FD_CLOEXEC
func (ts *Timestruc) Unix() (sec int64, nsec int64) { func (ts *Timestruc) Unix() (sec int64, nsec int64) {
return int64(ts.Sec), int64(ts.Nsec) return int64(ts.Sec), int64(ts.Nsec)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment