Skip to content

Commit 25f6609

Browse files
AlbanBedelralfbaechle
authored andcommitted
MIPS: zboot: Avoid useless rebuilds
Add dummy.o to the targets list, and fill targets automatically from $(vmlinuzobjs) to avoid having to maintain two lists. When building with XZ compression copy ashldi3.c to the build directory to use a different object file for the kernel and zboot. Without this the same object file need to be build with different flags which cause a rebuild at every run. Signed-off-by: Alban Bedel <albeu@free.fr> Cc: linux-mips@linux-mips.org Cc: Alex Smith <alex.smith@imgtec.com> Cc: Wu Zhangjin <wuzhangjin@gmail.com> Cc: Andrew Bresticker <abrestic@chromium.org> Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/11810/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent a7b4381 commit 25f6609

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

arch/mips/boot/compressed/Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
2929
-DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \
3030
-DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS)
3131

32-
targets := head.o decompress.o string.o dbg.o uart-16550.o uart-alchemy.o
33-
3432
# decompressor objects (linked with vmlinuz)
3533
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
3634

@@ -40,9 +38,13 @@ vmlinuzobjs-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o
4038
vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY) += $(obj)/uart-alchemy.o
4139
endif
4240

43-
ifdef CONFIG_KERNEL_XZ
44-
vmlinuzobjs-y += $(obj)/../../lib/ashldi3.o
45-
endif
41+
vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
42+
43+
$(obj)/ashldi3.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib
44+
$(obj)/ashldi3.c: $(srctree)/arch/mips/lib/ashldi3.c
45+
$(call cmd,shipped)
46+
47+
targets := $(notdir $(vmlinuzobjs-y))
4648

4749
targets += vmlinux.bin
4850
OBJCOPYFLAGS_vmlinux.bin := $(OBJCOPYFLAGS) -O binary -R .comment -S
@@ -60,7 +62,7 @@ targets += vmlinux.bin.z
6062
$(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE
6163
$(call if_changed,$(tool_y))
6264

63-
targets += piggy.o
65+
targets += piggy.o dummy.o
6466
OBJCOPYFLAGS_piggy.o := --add-section=.image=$(obj)/vmlinux.bin.z \
6567
--set-section-flags=.image=contents,alloc,load,readonly,data
6668
$(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE

0 commit comments

Comments
 (0)