Browse Source

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 <[email protected]>
(cherry picked from commit 1eb34b7287ed97ad1e2ae60a436babbb5c68076f)
Hauke Mehrtens 6 years ago
parent
commit
5cb845ebfe
1 changed files with 2 additions and 1 deletions
  1. 2 1
      package/system/mtd/Makefile

+ 2 - 1
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