[B.A.T.M.A.N.] [PATCH 6/9] alfred: Enable Link-time optimization

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

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 10% on mipsel (this includes parts which
were also removed by garbage collection).

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

diff --git a/alfred/Makefile b/alfred/Makefile
index ab19325..2656d1c 100644
--- a/alfred/Makefile
+++ b/alfred/Makefile
@@ -44,8 +44,8 @@ endef
MAKE_ALFRED_FLAGS=\
CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n)

-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

define Build/Compile
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
--
1.8.2.1