Skip to content

Commit 95617cb

Browse files
committed
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]: golang/go#9344 (comment) Subject: cmd/go: With Go 1.4, cannot statically link a program which imports net Signed-off-by: W. Trevor King <[email protected]>
1 parent c6de221 commit 95617cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tool:
1212

1313
.PHONY: runtimetest
1414
runtimetest:
15-
go build -tags "$(BUILDTAGS)" -o runtimetest ./cmd/runtimetest
15+
CGO_ENABLED=0 go build -installsuffix cgo -tags "$(BUILDTAGS)" -o runtimetest ./cmd/runtimetest
1616

1717
.PHONY: man
1818
man:

0 commit comments

Comments
 (0)