Make building static binaries simpler
This commit adds STATIC makefile variable to adjust LDFLAGS and build tags accordingly. Fixes #5824. Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
@@ -21,7 +21,9 @@ COMMANDS += containerd-shim containerd-shim-runc-v1 containerd-shim-runc-v2
|
||||
# check GOOS for cross compile builds
|
||||
ifeq ($(GOOS),linux)
|
||||
ifneq ($(GOARCH),$(filter $(GOARCH),mips mipsle mips64 mips64le ppc64))
|
||||
GO_GCFLAGS += -buildmode=pie
|
||||
ifeq ($(STATIC),)
|
||||
GO_GCFLAGS += -buildmode=pie
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user