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>
This commit is contained in:
parent
8c5702f2a0
commit
8d9ff6b6f7
1 changed files with 5 additions and 3 deletions
|
@ -37,11 +37,13 @@ CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
|
||||||
-mabi=32 -march=mips32r2 \
|
-mabi=32 -march=mips32r2 \
|
||||||
-Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap
|
-Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap
|
||||||
CFLAGS += -D_LZMA_PROB32
|
CFLAGS += -D_LZMA_PROB32
|
||||||
|
CFLAGS += -flto
|
||||||
|
|
||||||
ASFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
ASFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
||||||
|
|
||||||
LDFLAGS = -static --gc-sections -no-warn-mismatch
|
LDFLAGS = -static -Wl,--gc-sections -Wl,-no-warn-mismatch
|
||||||
LDFLAGS += -e startup -T loader.lds -Ttext $(LZMA_TEXT_START)
|
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)
|
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 $@ $<
|
$(LD) -r -b binary --oformat $(O_FORMAT) -T lzma-data.lds -o $@ $<
|
||||||
|
|
||||||
loader: $(OBJECTS)
|
loader: $(OBJECTS)
|
||||||
$(LD) $(LDFLAGS) -o $@ $(OBJECTS)
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS)
|
||||||
|
|
||||||
loader.bin: loader
|
loader.bin: loader
|
||||||
$(OBJCOPY) $(BIN_FLAGS) $< $@
|
$(OBJCOPY) $(BIN_FLAGS) $< $@
|
||||||
|
|
Loading…
Reference in a new issue