dnsmasq: Activate LTO
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 27 Oct 2019 20:17:39 +0000 (21:17 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 8 Nov 2019 22:57:51 +0000 (23:57 +0100)
This decreases the binary size when PIE ASLR is activated by 8% on MIPS BE.

old:
202,020 /usr/sbin/dnsmasq

new:
185,676 /usr/sbin/dnsmasq

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/network/services/dnsmasq/Makefile

index dc20ada292ab8db9aadb406fc30a828c3bd8c8ba..a1b51896a96ebc86ce0811632b214797730a4ef0 100644 (file)
@@ -126,8 +126,8 @@ endef
 Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
 Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles)
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -flto=jobserver
 
 COPTS = -DHAVE_UBUS \
        $(if $(CONFIG_IPV6),,-DNO_IPV6)