From 00adc542185ade4a0cd78c26beec84f38def4c69 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 23 Feb 2023 15:13:06 -0800 Subject: [PATCH] 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 --- src/net/net.go | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.48.1