From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 11 Jul 2018 17:42:40 +0000 (+0200)
Subject: ubus: compile with LTO enabled
X-Git-Tag: v19.07.0-rc1~3162
X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=154c0c4006daf41e2cbb6c8b7ad5557f83dfea3e;p=oweals%2Fopenwrt.git

ubus: compile with LTO enabled

Reduces total .ipk size by about 1k

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---

diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index 7dc3c92dea..523c3629fc 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -47,7 +47,8 @@ define Package/libubus-lua
   TITLE:=Lua binding for the OpenWrt RPC client
 endef
 
-TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
+TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -flto
+TARGET_LDFLAGS += -flto
 
 CMAKE_OPTIONS = \
 	-DLUAPATH=/usr/lib/lua