openvpn: reduce binary size using --gc-sections on linking
authorFelix Fietkau <nbd@nbd.name>
Sat, 10 Dec 2016 11:39:54 +0000 (12:39 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 22 Dec 2016 15:42:19 +0000 (16:42 +0100)
Saves around 9kb gzipped on MIPS

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

index 11b6aabe25a9ff838670750da535019c944b5cee..24fb897a0131c9173e020beff016f90f9c7aac10 100644 (file)
@@ -65,6 +65,9 @@ CONFIGURE_VARS += \
        IPROUTE=/sbin/ip \
        NETSTAT=/sbin/netstat
 
+TARGET_CFLAGS += -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -Wl,--gc-sections
+
 define Build/Configure
        $(call Build/Configure/Default, \
                $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SMALL),--enable-small) \