[B.A.T.M.A.N.] [PATCH 5/9] batman-adv-devel: Enable Link-time optimization

Sven Eckelmann
2013-05-07T12:51:09Z

Link-time optimization allows to move parts of the optimization from the single
source file to the global source view. This is done by emitting the GIMPLE
representation in each object file and analyzing it again during the link step.

This reduces the binary size by around 6% on mipsel (this includes parts which
were also removed by garbage collection).

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
batman-adv-devel/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile
index 6dc66b8..cad95c6 100644
--- a/batman-adv-devel/Makefile
+++ b/batman-adv-devel/Makefile
@@ -76,8 +76,8 @@ MAKE_BATCTL_ARGS += \
STRIP="/bin/true" \
batctl install

-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
+TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin

ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_DEVEL_BATCTL),)
define Download/batctl
--
1.8.2.1