From: Hauke Mehrtens Date: Sun, 27 Oct 2019 21:32:59 +0000 (+0100) Subject: mtd: Activate LTO compile option X-Git-Tag: v19.07.0-rc2~5 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5cb845ebfedb57716d8694026b9d3f3a2638d2bf;p=openwrt%2Fstaging%2Fpepe2k.git mtd: Activate LTO compile option This decreases the size of the mtd application by 25% on MIPS BE. old: 20,597 /sbin/mtd new: 16,421 /sbin/mtd Signed-off-by: Hauke Mehrtens (cherry picked from commit 1eb34b7287ed97ad1e2ae60a436babbb5c68076f) --- diff --git a/package/system/mtd/Makefile b/package/system/mtd/Makefile index c307555436..17df3bc475 100644 --- a/package/system/mtd/Makefile +++ b/package/system/mtd/Makefile @@ -36,7 +36,8 @@ endef target=$(firstword $(subst -, ,$(BOARD))) MAKE_FLAGS += TARGET="$(target)" -TARGET_CFLAGS := $(TARGET_CFLAGS) -Dtarget_$(target)=1 -Wall +TARGET_CFLAGS += -Dtarget_$(target)=1 -Wall -flto +TARGET_LDFLAGS += -flto=jobserver ifdef CONFIG_MTD_REDBOOT_PARTS MAKE_FLAGS += FIS_SUPPORT=1