summaryrefslogtreecommitdiffstats
path: root/libgo
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
parentlibbacktrace: initialize DWARF 5 fields of unit (diff)
downloadgcc-24ca97325cab7bc454c785d55f37120fe7ea6f74.tar.gz
gcc-24ca97325cab7bc454c785d55f37120fe7ea6f74.tar.bz2
gcc-24ca97325cab7bc454c785d55f37120fe7ea6f74.tar.xz
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')
-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 f59a1aa33ba..c935c4540cf 100644
--- a/libgo/go/net/fcntl_libc_test.go
+++ b/libgo/go/net/fcntl_libc_test.go
@@ -6,7 +6,10 @@
6 6
7package net 7package net
8 8
9import "syscall" 9import (
10 "syscall"
11 _ "unsafe"
12)
10 13
11// Use a helper function to call fcntl. This is defined in C in 14// Use a helper function to call fcntl. This is defined in C in
12// libgo/runtime. 15// libgo/runtime.
diff --git a/libgo/go/os/signal/internal/pty/pty.go b/libgo/go/os/signal/internal/pty/pty.go
index e5ee3f6dc01..01c3908becf 100644
--- a/libgo/go/os/signal/internal/pty/pty.go
+++ b/libgo/go/os/signal/internal/pty/pty.go
@@ -2,7 +2,7 @@
2// Use of this source code is governed by a BSD-style 2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file. 3// license that can be found in the LICENSE file.
4 4
5//go:build (aix || darwin || dragonfly || freebsd || hurd || (linux && !android) || netbsd || openbsd) && cgo 5//go:build (aix || darwin || dragonfly || freebsd || hurd || (linux && !android) || netbsd || openbsd || solaris) && cgo
6 6
7// Package pty is a simple pseudo-terminal package for Unix systems, 7// Package pty is a simple pseudo-terminal package for Unix systems,
8// implemented by calling C functions via cgo. 8// implemented by calling C functions via cgo.
diff --git a/libgo/go/runtime/os3_solaris.go b/libgo/go/runtime/os3_solaris.go
index ec23ce2cc0c..6c825746fbc 100644
--- a/libgo/go/runtime/os3_solaris.go
+++ b/libgo/go/runtime/os3_solaris.go
@@ -36,6 +36,14 @@ func solarisExecutablePath() string {
36 return executablePath 36 return executablePath
37} 37}
38 38
39func setProcessCPUProfiler(hz int32) {
40 setProcessCPUProfilerTimer(hz)
41}
42
43func setThreadCPUProfiler(hz int32) {
44 setThreadCPUProfilerHz(hz)
45}
46
39//go:nosplit 47//go:nosplit
40func validSIGPROF(mp *m, c *sigctxt) bool { 48func validSIGPROF(mp *m, c *sigctxt) bool {
41 return true 49 return true
diff --git a/libgo/go/runtime/stubs2.go b/libgo/go/runtime/stubs2.go
index 0b9e60587e1..587109209d1 100644
--- a/libgo/go/runtime/stubs2.go
+++ b/libgo/go/runtime/stubs2.go
@@ -2,7 +2,7 @@
2// Use of this source code is governed by a BSD-style 2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file. 3// license that can be found in the LICENSE file.
4 4
5//go:build !aix && !darwin && !js && !openbsd && !plan9 && !solaris && !windows 5//go:build !js && !plan9 && !windows
6 6
7package runtime 7package runtime
8 8
diff --git a/libgo/go/syscall/exec_bsd.go b/libgo/go/syscall/exec_bsd.go
index c05ae138811..ff88bc45366 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
143 // User and groups 143 // User and groups
144 if cred := sys.Credential; cred != nil { 144 if cred := sys.Credential; cred != nil {
145 ngroups := len(cred.Groups) 145 ngroups := len(cred.Groups)
146 var groups *Gid_t 146 var groups unsafe.Pointer
147 if ngroups > 0 { 147 if ngroups > 0 {
148 gids := make([]Gid_t, ngroups) 148 gids := make([]Gid_t, ngroups)
149 for i, v := range cred.Groups { 149 for i, v := range cred.Groups {
150 gids[i] = Gid_t(v) 150 gids[i] = Gid_t(v)
151 } 151 }
152 groups = &gids[0] 152 groups = unsafe.Pointer(&gids[0])
153 } 153 }
154 if !cred.NoSetGroups { 154 if !cred.NoSetGroups {
155 err1 = raw_setgroups(ngroups, groups) 155 err1 = raw_setgroups(ngroups, groups)
diff --git a/libgo/go/syscall/export_unix_test.go b/libgo/go/syscall/export_unix_test.go
index 184eb84c0b1..bd904c70f36 100644
--- a/libgo/go/syscall/export_unix_test.go
+++ b/libgo/go/syscall/export_unix_test.go
@@ -2,7 +2,7 @@
2// Use of this source code is governed by a BSD-style 2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file. 3// license that can be found in the LICENSE file.
4 4
5//go:build dragonfly || freebsd || hurd || linux || netbsd || openbsd 5//go:build dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
6 6
7package syscall 7package syscall
8 8
diff --git a/libgo/go/syscall/syscall_solaris.go b/libgo/go/syscall/syscall_solaris.go
index 13c60a493d9..673ba8223fc 100644
--- a/libgo/go/syscall/syscall_solaris.go
+++ b/libgo/go/syscall/syscall_solaris.go
@@ -6,8 +6,6 @@ package syscall
6 6
7import "unsafe" 7import "unsafe"
8 8
9const _F_DUP2FD_CLOEXEC = F_DUP2FD_CLOEXEC
10
11func (ts *Timestruc) Unix() (sec int64, nsec int64) { 9func (ts *Timestruc) Unix() (sec int64, nsec int64) {
12 return int64(ts.Sec), int64(ts.Nsec) 10 return int64(ts.Sec), int64(ts.Nsec)
13} 11}