From e30e65f7a8bda0351d9def5a6bc91471bddafd3d Mon Sep 17 00:00:00 2001 From: qmuntal Date: Thu, 5 Mar 2026 12:19:20 +0100 Subject: 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 Reviewed-by: Mark Freeman LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor Auto-Submit: Quim Muntal --- src/runtime/cgo/cgo.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/runtime') diff --git a/src/runtime/cgo/cgo.go b/src/runtime/cgo/cgo.go index d356c19d3f..09ec803769 100644 --- a/src/runtime/cgo/cgo.go +++ b/src/runtime/cgo/cgo.go @@ -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. -- cgit v1.3-5-g9baa