diff mbox series

[LEDE-DEV,5/5] mtd-utils: activate --gc-sections

Message ID 20180415225325.15797-5-hauke@hauke-m.de
State Superseded
Headers show
Series [LEDE-DEV,1/5] tools/zlib: move zlib build to tools | expand

Commit Message

Hauke Mehrtens April 15, 2018, 10:53 p.m. UTC
This reduces the size of the binary a bit:

old:
 37556 bin/targets/lantiq/xrx200/packages/nand-utils_2.0.1-1_mips_24kc.ipk
 81697 bin/targets/lantiq/xrx200/packages/ubi-utils_2.0.1-1_mips_24kc.ipk

new:
 27450 bin/targets/lantiq/xrx200/packages/nand-utils_2.0.1-1_mips_24kc.ipk
 71796 bin/targets/lantiq/xrx200/packages/ubi-utils_2.0.1-1_mips_24kc.ipk

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 package/utils/mtd-utils/Makefile | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile
index a9905e4207..b9c3c19568 100644
--- a/package/utils/mtd-utils/Makefile
+++ b/package/utils/mtd-utils/Makefile
@@ -62,6 +62,9 @@  CONFIGURE_ARGS += \
 	--without-xattr \
 	--without-lzo
 
+TARGET_CFLAGS += -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -Wl,--gc-sections
+
 define Package/ubi-utils/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) \