diff --git a/mk/golang.mk b/mk/golang.mk index 5d70f02baed..73073370194 100644 --- a/mk/golang.mk +++ b/mk/golang.mk @@ -6,13 +6,12 @@ export GO111MODULE=on # pre-definitions GOCC ?= go GOTAGS ?= +unexport GOFLAGS +GOFLAGS ?= GOTFLAGS ?= -# Unexport GOFLAGS so we only apply it where we actually want it. -unexport GOFLAGS # Try to make building as reproducible as possible by stripping the go path. -# Override so we can combine with the user's go flags. -override GOFLAGS += -trimpath +GOFLAGS += "-asmflags=all='-trimpath=$(GOPATH)'" "-gcflags=all='-trimpath=$(GOPATH)'" ifeq ($(tarball-is),1) GOFLAGS += -mod=vendor