]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
libgo: restore building on Solaris
authorIan Lance Taylor <iant@golang.org>
Wed, 16 Feb 2022 19:30:04 +0000 (11:30 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 16 Feb 2022 20:20:10 +0000 (12:20 -0800)
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

gcc/go/gofrontend/MERGE
libgo/go/net/fcntl_libc_test.go
libgo/go/os/signal/internal/pty/pty.go
libgo/go/runtime/os3_solaris.go
libgo/go/runtime/stubs2.go
libgo/go/syscall/exec_bsd.go
libgo/go/syscall/export_unix_test.go
libgo/go/syscall/syscall_solaris.go

index 745132a3d9d16a93be2a66c7d474dfb63d313671..3742414c82824ce337c30c82bf175838d0b2d77d 100644 (file)
@@ -1,4 +1,4 @@
-0af68c0552341a44f1fb12301f9eff954b9dde88
+3742e8a154bfec805054b4ebf0809f12dc7694da
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index f59a1aa33ba76e320f0472fc0fa7212b8a9c1829..c935c4540cf9bbd6776f75c701f923fec1bcce4d 100644 (file)
@@ -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.
index e5ee3f6dc012ca39bd8823d8fdefc8632fe2444b..01c3908becf746cd7786f75e3a557d396de5657d 100644 (file)
@@ -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.
index ec23ce2cc0c53674a82567d199d83cd770f01b86..6c825746fbc049247eefb56d29a6885d3fdd2029 100644 (file)
@@ -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
index 0b9e60587e175539cae07376923226303f8e1cd4..587109209d18bbc7734c25e87b7e34d608010c6e 100644 (file)
@@ -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
 
index c05ae138811f891243b5d0737a7b9ddaaae564ca..ff88bc45366fbd2505ad0e1bb19274ceb9027c2e 100644 (file)
@@ -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)
index 184eb84c0b140ef5fb26163b6054ec51c74c0033..bd904c70f36b566cc5ab7a856a8ab82cb6218c7c 100644 (file)
@@ -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
 
index 13c60a493d97a48d5d6f35f9c112c79653f05f77..673ba8223fc8fef58a00a7fe47d0af6c4be5002a 100644 (file)
@@ -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)
 }