From bcdd6e64fad2e04f06f62c32dd4d17ddcdeda5c8 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 12 May 2020 19:54:14 +0800 Subject: [PATCH] golang: Remove RSTRIP definition from golang-package.mk Since RSTRIP is defined in rules.mk as a recursively expanded variable, there is no need to define it again after setting STRIP in golang-package.mk. This also adds a note to the comment for GO_PKG_LDFLAGS to say that -s and -w flags are not necessary. Signed-off-by: Jeffery To --- lang/golang/golang-package.mk | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lang/golang/golang-package.mk b/lang/golang/golang-package.mk index 303ae0eb3..de7ef336d 100644 --- a/lang/golang/golang-package.mk +++ b/lang/golang/golang-package.mk @@ -89,7 +89,12 @@ include $(GO_INCLUDE_DIR)/golang-values.mk # # Additional go tool link arguments to use when building targets. # -# e.g. GO_PKG_LDFLAGS:=-s -w +# Note that the OpenWrt build system has an option to strip binaries +# (enabled by default), so -s (Omit the symbol table and debug +# information) and -w (Omit the DWARF symbol table) flags are not +# necessary. +# +# e.g. GO_PKG_LDFLAGS:=-r dir1:dir2 -u # # # GO_PKG_LDFLAGS_X - list of string variable definitions, default empty @@ -147,16 +152,6 @@ ifneq ($(CONFIG_USE_SSTRIP),) GO_PKG_STRIP_ARGS:=--strip-all endif STRIP:=$(TARGET_CROSS)strip $(GO_PKG_STRIP_ARGS) - RSTRIP= \ - export CROSS="$(TARGET_CROSS)" \ - $(if $(PKG_BUILD_ID),KEEP_BUILD_ID=1) \ - $(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1) \ - $(if $(CONFIG_KERNEL_PROFILING),KEEP_SYMBOLS=1); \ - NM="$(TARGET_CROSS)nm" \ - STRIP="$(STRIP)" \ - STRIP_KMOD="$(SCRIPT_DIR)/strip-kmod.sh" \ - PATCHELF="$(STAGING_DIR_HOST)/bin/patchelf" \ - $(SCRIPT_DIR)/rstrip.sh endif define GoPackage/GoSubMenu