mirror of
https://github.com/golang/go.git
synced 2026-04-02 09:20:29 +09:00
syscall,runtime/cgo: use cgo_ldflag to link against -lsocket and -lxnet on Solaris
The -lsocket and -lxnet flags are needed for accept4 syscall on Solaris. The runtime/cgo package doens't use them, so it doesn't make sense for it to explicitly link against those libraries. Instead, use the //go:cgo_ldflag in the syscall package. Cq-Include-Trybots: luci.golang.try:gotip-solaris-amd64 Change-Id: I10db524ebf1c720a460515d8c1f362b0070bd771 Reviewed-on: https://go-review.googlesource.com/c/go/+/751760 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Auto-Submit: Quim Muntal <quimmuntal@gmail.com>
This commit is contained in:
@@ -20,8 +20,6 @@ package cgo
|
||||
#cgo netbsd LDFLAGS: -lpthread
|
||||
#cgo openbsd LDFLAGS: -lpthread
|
||||
#cgo aix LDFLAGS: -Wl,-berok
|
||||
#cgo solaris LDFLAGS: -lxnet
|
||||
#cgo solaris LDFLAGS: -lsocket
|
||||
|
||||
// Use -fno-stack-protector to avoid problems locating the
|
||||
// proper support functions. See issues #52919, #54313, #58385.
|
||||
|
||||
@@ -71,6 +71,9 @@ func Pipe2(p []int, flags int) error {
|
||||
return err
|
||||
}
|
||||
|
||||
//go:cgo_ldflag "-lxnet"
|
||||
//go:cgo_ldflag "-lsocket"
|
||||
|
||||
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) = libsocket.accept4
|
||||
|
||||
func Accept4(fd int, flags int) (int, Sockaddr, error) {
|
||||
|
||||
Reference in New Issue
Block a user