On i386, currently go autodetects SSE at build time, and produces

binaries appropriate for the build machine. This doesn't work for
package builds where packages are produced on a machine with SSE
but are expected to work on machines without. Set GO386=387 during
the build to disable this. OK/improved comment from jsing@.
This commit is contained in:
sthen 2019-11-19 09:17:06 +00:00
parent 8675561e3f
commit a8a3b70b58
2 changed files with 16 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.75 2019/10/24 16:22:07 jsing Exp $
# $OpenBSD: Makefile,v 1.76 2019/11/19 09:17:06 sthen Exp $
ONLY_FOR_ARCHS = ${GO_ARCHS}
@ -8,6 +8,7 @@ BIN_BOOTSTRAP_VERSION = 1.13
COMMENT = Go programming language
VERSION = 1.13.3
REVISION = 0
DISTNAME = go${VERSION}.src
PKGNAME = go-${VERSION}
PKGSPEC = go-=${VERSION}
@ -55,6 +56,11 @@ GOARCH = arm64
GOARCH = 386
.endif
# We cannot assume that the maching running the built code will have SSE,
# even though the machine building the package has SSE. As such, we need
# to explicitly disable SSE on i386 builds.
MAKE_ENV += GO386=387
.for arch in ${BIN_BOOTSTRAP_GOARCHS}
SUPDISTFILES += go-openbsd-${arch}-bootstrap-${BIN_BOOTSTRAP_VERSION}${EXTRACT_SUFX}:0

View File

@ -1,4 +1,4 @@
# $OpenBSD: go.port.mk,v 1.26 2019/10/06 15:37:15 sthen Exp $
# $OpenBSD: go.port.mk,v 1.27 2019/11/19 09:17:06 sthen Exp $
ONLY_FOR_ARCHS ?= ${GO_ARCHS}
@ -33,8 +33,14 @@ MODGO_TYPE ?= bin
MODGO_WORKSPACE ?= ${WRKDIR}/go
MODGO_GOCACHE ?= ${WRKDIR}/go-cache
MODGO_GOPATH ?= ${MODGO_WORKSPACE}:${MODGO_PACKAGE_PATH}
MAKE_ENV += GOCACHE="${MODGO_GOCACHE}" GOPATH="${MODGO_GOPATH}" GO111MODULE=off
# ports are not allowed to fetch from the network at build time; point
MAKE_ENV += GOCACHE="${MODGO_GOCACHE}" \
GOPATH="${MODGO_GOPATH}" \
GO111MODULE=off
# We cannot assume that the maching running the built code will have SSE,
# even though the machine building the package has SSE. As such, we need
# to explicitly disable SSE on i386 builds.
MAKE_ENV += GO386=387
# Ports are not allowed to fetch from the network at build time; point
# GOPROXY at an unreachable host so that failures are also visible to
# developers who don't have PORTS_PRIVSEP and a "deny .. _pbuild" PF rule.
MAKE_ENV += GOPROXY=invalid://ports.should.not.fetch.at.buildtime/