From: Ian Lance Taylor Date: Thu, 23 Feb 2023 23:13:06 +0000 (-0800) Subject: net: document that on macOS c-archive requires -lresolv X-Git-Tag: go1.21rc1~1482 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=00adc542185ade4a0cd78c26beec84f38def4c69;p=gostls13.git net: document that on macOS c-archive requires -lresolv For #58159 Change-Id: Iff8e017c568be111c494992cb6fe62d469e0f981 Reviewed-on: https://go-review.googlesource.com/c/go/+/470917 Reviewed-by: Brad Fitzpatrick Reviewed-by: Bryan Mills Auto-Submit: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Than McIntosh TryBot-Result: Gopher Robot --- diff --git a/src/net/net.go b/src/net/net.go index 0a4f7471c4..a9e9a6478a 100644 --- a/src/net/net.go +++ b/src/net/net.go @@ -71,6 +71,10 @@ to print debugging information about its decisions. To force a particular resolver while also printing debugging information, join the two settings by a plus sign, as in GODEBUG=netdns=go+1. +On macOS, if Go code that uses the net package is built with +-buildmode=c-archive, linking the resulting archive into a C program +requires passing -lresolv when linking the C code. + On Plan 9, the resolver always accesses /net/cs and /net/dns. On Windows, in Go 1.18.x and earlier, the resolver always used C