From 8f03b67ade9d9b0121dc93d866d3fbd5dcc84bdf Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Mon, 18 Apr 2016 15:28:41 +0100 Subject: [PATCH] Add -s & -w flags to omit various symbol tables from the binary. This does not effect backtraces. Before the scope binary was 49M, now its 32M. For more detauls, see https://blog.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/ --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 34521d84c..891b50b32 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ GO_HOST=$(NO_CROSS_COMP); $(GO) WITH_GO_HOST_ENV=$(NO_CROSS_COMP); $(GO_ENV) GO_BUILD_INSTALL_DEPS=-i GO_BUILD_TAGS='netgo unsafe' -GO_BUILD_FLAGS=$(GO_BUILD_INSTALL_DEPS) -ldflags "-extldflags \"-static\" -X main.version=$(SCOPE_VERSION)" -tags $(GO_BUILD_TAGS) +GO_BUILD_FLAGS=$(GO_BUILD_INSTALL_DEPS) -ldflags "-extldflags \"-static\" -X main.version=$(SCOPE_VERSION) -s -w" -tags $(GO_BUILD_TAGS) all: $(SCOPE_EXPORT)