Skip to content

Commit 7203178

Browse files
Merge pull request #12327 from zeha/backport-11976
Backport #11976 to 3.4
2 parents 4808a63 + 25f35ac commit 7203178

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,15 @@ define go-get
173173
$(GO) get -u ${1}
174174
endef
175175

176+
# Need to use CGO for mDNS resolution, but cross builds need CGO disabled
177+
# See https://github.com/golang/go/issues/12524 for details
178+
DARWIN_GCO := 0
179+
ifeq ($(NATIVE_GOOS),darwin)
180+
ifdef HOMEBREW_PREFIX
181+
DARWIN_GCO := 1
182+
endif
183+
endif
184+
176185
###
177186
### Primary entry-point targets
178187
###
@@ -349,7 +358,7 @@ podman-remote-windows: ## Build podman-remote for Windows
349358
.PHONY: podman-remote-darwin
350359
podman-remote-darwin: ## Build podman-remote for macOS
351360
$(MAKE) \
352-
CGO_ENABLED=0 \
361+
CGO_ENABLED=$(DARWIN_GCO) \
353362
GOOS=darwin \
354363
bin/darwin/podman
355364

0 commit comments

Comments
 (0)