aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Dusser <julien.dusser@free.fr>2017-07-19 15:45:08 +0200
committerFelix Fietkau <nbd@nbd.name>2017-10-24 13:24:04 +0200
commit8d9ff6b6f7b2ba0c3dcba926099f819af871e0a8 (patch)
tree270f6ebec470d2229ea11b7589bd78cc7074d4fc
parent8c5702f2a07cebfbee6f9e628b63d88b8806ca1b (diff)
downloadupstream-8d9ff6b6f7b2ba0c3dcba926099f819af871e0a8.tar.gz
upstream-8d9ff6b6f7b2ba0c3dcba926099f819af871e0a8.tar.bz2
upstream-8d9ff6b6f7b2ba0c3dcba926099f819af871e0a8.zip
ar71xx: lzma loader use LTO
Change the Makefile to use LTO for better code optimisations. Gains are very low, only 270 bytes saved, but it's only Makefile changes. Signed-off-by: Julien Dusser <julien.dusser@free.fr>
-rw-r--r--target/linux/ar71xx/image/lzma-loader/src/Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile
index 5f10bdb8f1..682b31fe8c 100644
--- a/target/linux/ar71xx/image/lzma-loader/src/Makefile
+++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile
@@ -37,11 +37,13 @@ CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-mabi=32 -march=mips32r2 \
-Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap
CFLAGS += -D_LZMA_PROB32
+CFLAGS += -flto
ASFLAGS = $(CFLAGS) -D__ASSEMBLY__
-LDFLAGS = -static --gc-sections -no-warn-mismatch
-LDFLAGS += -e startup -T loader.lds -Ttext $(LZMA_TEXT_START)
+LDFLAGS = -static -Wl,--gc-sections -Wl,-no-warn-mismatch
+LDFLAGS += -Wl,-e,startup -T loader.lds -Wl,-Ttext,$(LZMA_TEXT_START)
+LDFLAGS += -flto -fwhole-program
O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
@@ -86,7 +88,7 @@ data.o: $(LOADER_DATA)
$(LD) -r -b binary --oformat $(O_FORMAT) -T lzma-data.lds -o $@ $<
loader: $(OBJECTS)
- $(LD) $(LDFLAGS) -o $@ $(OBJECTS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS)
loader.bin: loader
$(OBJCOPY) $(BIN_FLAGS) $< $@