From 95617cb6335c555942b85967b8f3b9e07a375d90 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 8 Aug 2017 23:14:35 -0700 Subject: [PATCH] Makefile: Set CGO_ENABLED=0 for runtimetest And also set '-installsuffix cgo'. runtimetest is designed to be run from inside a container, which may include a mount namespace that has no linker or dynamic libraries. These changes give us a static runtimetest binary [1,2] which will work in those conditions. [1]: https://golang.org/cmd/cgo/#hdr-Using_cgo_with_the_go_command [2]: https://github.com/golang/go/issues/9344#issuecomment-69944514 Subject: cmd/go: With Go 1.4, cannot statically link a program which imports net Signed-off-by: W. Trevor King --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7bf37bfc2..77626d22c 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ tool: .PHONY: runtimetest runtimetest: - go build -tags "$(BUILDTAGS)" -o runtimetest ./cmd/runtimetest + CGO_ENABLED=0 go build -installsuffix cgo -tags "$(BUILDTAGS)" -o runtimetest ./cmd/runtimetest .PHONY: man man: