iw: compile with LTO enabled
authorFelix Fietkau <nbd@nbd.name>
Wed, 11 Jul 2018 17:21:08 +0000 (19:21 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 13 Jul 2018 15:22:53 +0000 (17:22 +0200)
Reduces .ipk size on MIPS from 34k to 33k

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/utils/iw/Makefile

index 912fc3e28d24329acac7f59cc027eb95e1b61f03..22f110651b4eca9476e9711fb8dce8ae6c2e79c2 100644 (file)
@@ -38,11 +38,12 @@ TARGET_CPPFLAGS:= \
        -I$(STAGING_DIR)/usr/include/libnl-tiny \
        $(TARGET_CPPFLAGS) \
        -DCONFIG_LIBNL20 \
-       -D_GNU_SOURCE
+       -D_GNU_SOURCE \
+       -flto
 
 MAKE_FLAGS += \
        CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -ffunction-sections -fdata-sections" \
-       LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \
+       LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections -flto" \
        NL1FOUND="" NL2FOUND=Y \
        NLLIBNAME="libnl-tiny" \
        LIBS="-lm -lnl-tiny" \