summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2022-09-12 12:16:05 +0000
committerjperkin <jperkin@pkgsrc.org>2022-09-12 12:16:05 +0000
commit21d505c1481ddc2329f2317bb22cca4ab261d508 (patch)
treec322a5d1545575eb4a6000345e52ba64dddecccb /lang
parent4e560bbd51e026e7d779fcdc2762fc3c0140eba7 (diff)
downloadpkgsrc-21d505c1481ddc2329f2317bb22cca4ab261d508.tar.gz
go: Force GOHOSTARCH for Darwin x86_64.
Fixes builds of go118 and newer in x86_64 chroots on an arm64 host. The go build system parses "uname -v" and incorrectly assumes that if you're running on an arm64 host you always want arm64 binaries.
Diffstat (limited to 'lang')
-rw-r--r--lang/go/version.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/lang/go/version.mk b/lang/go/version.mk
index 0ed76a88c35..7a3334e1100 100644
--- a/lang/go/version.mk
+++ b/lang/go/version.mk
@@ -1,4 +1,4 @@
-# $NetBSD: version.mk,v 1.158 2022/09/07 06:36:32 bsiegert Exp $
+# $NetBSD: version.mk,v 1.159 2022/09/12 12:16:05 jperkin Exp $
#
# If bsd.prefs.mk is included before go-package.mk in a package, then this
@@ -46,6 +46,10 @@ GOCHAR= 8
.elif ${MACHINE_ARCH} == "x86_64"
GOARCH= amd64
GOCHAR= 6
+# go118 hardcodes GOARCH=arm64 even when running in an x86_64 chroot
+. if ${OPSYS} == "Darwin"
+GOOPT+= GOHOSTARCH=amd64
+. endif
.elif ${MACHINE_ARCH} == "earmv6hf" || ${MACHINE_ARCH} == "earmv7hf"
GOARCH= arm
GOCHAR= 5