From 85852733af863b93715f26885402c94506e75326 Mon Sep 17 00:00:00 2001 From: nsa Date: Thu, 7 May 2020 14:20:59 -0400 Subject: [PATCH] Makefile: add -w to -ldflags to strip DWARF symbols Compiling with this flag cuts down on the binary size by several megabytes. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 10a6de84..24d15ecb 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ make_ldflags = $(2) -X $(PKG)/build.Commit=$(COMMIT) \ -X $(PKG)/build.GoVersion=$(GOVERSION) \ -X $(PKG)/build.RawTags=$(shell echo $(1) | sed -e 's/ /,/g') -LDFLAGS := -ldflags "$(call make_ldflags, ${tags})" +LDFLAGS := -ldflags "$(call make_ldflags, ${tags}, -s -w)" DEV_LDFLAGS := -ldflags "$(call make_ldflags, $(DEV_TAGS))" ITEST_LDFLAGS := -ldflags "$(call make_ldflags, $(ITEST_TAGS))"