miniupnpd: build with gc-sections & LTO
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Tue, 8 May 2018 17:11:16 +0000 (18:11 +0100)
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Wed, 9 May 2018 19:02:17 +0000 (20:02 +0100)
Building with --gc-sections & -flto drop ipk size from 72600 to 66345
on MIPS

No misbehaviour due to these optimisations observed.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
net/miniupnpd/Makefile

index f7e3c39bc212e111066407b134c231c0e291a2d3..ba9929418162d50776ffb176d4a52f5cb92d2d7f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=miniupnpd
 PKG_VERSION:=2.0.20180503
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://miniupnp.free.fr/files
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -39,6 +39,8 @@ define Build/Prepare
        echo "$(VERSION_NUMBER)" | tr '() ' '_' >$(PKG_BUILD_DIR)/os.openwrt
 endef
 
+TARGET_CFLAGS += -flto -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -flto -Wl,--gc-sections
 MAKE_FLAGS += \
        TARGET_OPENWRT=1 TEST=0 LIBS="" \
        CC="$(TARGET_CC) -DIPTABLES_143 -lip4tc -luuid \