diff options
author | Tobias Schramm <tobleminer@gmail.com> | 2018-05-03 16:27:10 +0200 |
---|---|---|
committer | Mathias Kresin <dev@kresin.me> | 2018-06-21 06:54:42 +0200 |
commit | 4fa85a625f33c4602511dc5b2ee406329bf289c2 (patch) | |
tree | a28624cd04306a658a29f972e5760154fee2fee1 /target/linux/ramips/image/lzma-loader/src/Makefile | |
parent | feb0a0bf22143326b3b3515ab0bb4682194dc75a (diff) | |
download | upstream-4fa85a625f33c4602511dc5b2ee406329bf289c2.tar.gz upstream-4fa85a625f33c4602511dc5b2ee406329bf289c2.tar.bz2 upstream-4fa85a625f33c4602511dc5b2ee406329bf289c2.zip |
ramips: Add support for mt7621 to lzma-loader
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
Diffstat (limited to 'target/linux/ramips/image/lzma-loader/src/Makefile')
-rw-r--r-- | target/linux/ramips/image/lzma-loader/src/Makefile | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/target/linux/ramips/image/lzma-loader/src/Makefile b/target/linux/ramips/image/lzma-loader/src/Makefile index f861666e62..d20cd77346 100644 --- a/target/linux/ramips/image/lzma-loader/src/Makefile +++ b/target/linux/ramips/image/lzma-loader/src/Makefile @@ -22,35 +22,39 @@ BOARD := FLASH_OFFS := FLASH_MAX := PLATFORM := +CACHE_FLAGS := CC := $(CROSS_COMPILE)gcc LD := $(CROSS_COMPILE)ld OBJCOPY := $(CROSS_COMPILE)objcopy OBJDUMP := $(CROSS_COMPILE)objdump -BIN_FLAGS := -O binary -R .reginfo -R .note -R .comment -R .mdebug -S + +include $(PLATFORM).mk + +BIN_FLAGS := -O binary -R .reginfo -R .note -R .comment -R .mdebug \ + -R .MIPS.abiflags -S CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ -fno-strict-aliasing -fno-common -fomit-frame-pointer -G 0 \ -mno-abicalls -fno-pic -ffunction-sections -pipe -mlong-calls \ - -fno-common -ffreestanding -fhonour-copts \ + -fno-common -ffreestanding -fhonour-copts -nostartfiles \ -mabi=32 -march=mips32r2 \ -Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap -CFLAGS += -D_LZMA_PROB32 -DARCH=$(PLATFORM) +CFLAGS += -D_LZMA_PROB32 +CFLAGS += -flto +CFLAGS += $(CACHE_FLAGS) 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 -Wl,-z,max-page-size=4096 O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32) OBJECTS := head.o loader.o cache.o board-$(PLATFORM).o printf.o LzmaDecode.o -include $(PLATFORM).mk -CFLAGS+=$(CACHE_FLAGS) -ASFLAGS+=$(CACHE_FLAGS) - ifneq ($(strip $(LOADER_DATA)),) OBJECTS += data.o CFLAGS += -DLZMA_WRAPPER=1 -DLOADADDR=$(LOADADDR) @@ -68,11 +72,6 @@ ifneq ($(strip $(FLASH_MAX)),) CFLAGS += -DCONFIG_FLASH_MAX=$(FLASH_MAX) endif -BOARD_DEF := $(shell echo $(strip $(BOARD)) | tr a-z A-Z | tr - _) -ifneq ($(BOARD_DEF),) -CFLAGS += -DCONFIG_BOARD_$(BOARD_DEF) -endif - all: loader.elf # Don't build dependencies, this may die if $(CC) isn't gcc @@ -90,7 +89,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) $< $@ @@ -99,7 +98,7 @@ loader2.o: loader.bin $(LD) -r -b binary --oformat $(O_FORMAT) -o $@ $< loader.elf: loader2.o - $(LD) -e startup -T loader2.lds -Ttext $(LOADADDR) -o $@ $< + $(LD) -e startup -T loader2.lds -Ttext $(LOADADDR) -z max-page-size=4096 -o $@ $< mrproper: clean |