Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315585

[PATCH v2 2/4] MIPS: zboot: Avoid useless rebuilds

From Alban Bedel <albeu@free.fr>
Newsgroups linux.kernel
Subject [PATCH v2 2/4] MIPS: zboot: Avoid useless rebuilds
Date 2016-01-23 14:00 +0100
Message-ID <qU5Xl-2Mq-3@gated-at.bofh.it> (permalink)
References <qU5Xl-2Mq-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


dummy.o is missing from the targets list which cause useless rebuilds.
Instead of adding it to the target list we now fill the list
automatically from $(vmlinuzobjs) to avoid having to maintain two
lists.

Building with XZ compression also lead to useless rebuilds because it
reuse source files from another directory. The kernel and zboot
wrapper use different flags, so if these object are built for the
kernel, they then get overwritten by the zboot wrapper version.
In the next build these object files are missing for the kernel,
so they get rebuild again, and then again for the zboot wrapper. To
solve this we copy the source files to the build directory to avoid
overwritting the kernel objects.

Signed-off-by: Alban Bedel <albeu@free.fr>
---
Changelog:
v2: * Properly delete the copied source files on clean
    * Rewrote the commit log to better explain the problem
---
 arch/mips/boot/compressed/Makefile | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index 45f8abb..2d5d97f 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -29,8 +29,6 @@ KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
 	-DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \
 	-DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS)
 
-targets := head.o decompress.o string.o dbg.o uart-16550.o uart-alchemy.o
-
 # decompressor objects (linked with vmlinuz)
 vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
 
@@ -40,9 +38,14 @@ vmlinuzobjs-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o
 vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)		   += $(obj)/uart-alchemy.o
 endif
 
-ifdef CONFIG_KERNEL_XZ
-vmlinuzobjs-y += $(obj)/../../lib/ashldi3.o $(obj)/../../lib/bswapsi.o
-endif
+vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o
+
+extra-y += ashldi3.c bswapsi.c
+$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib
+$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c
+	$(call cmd,shipped)
+
+targets := $(notdir $(vmlinuzobjs-y))
 
 targets += vmlinux.bin
 OBJCOPYFLAGS_vmlinux.bin := $(OBJCOPYFLAGS) -O binary -R .comment -S
@@ -60,7 +63,7 @@ targets += vmlinux.bin.z
 $(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE
 	$(call if_changed,$(tool_y))
 
-targets += piggy.o
+targets += piggy.o dummy.o
 OBJCOPYFLAGS_piggy.o := --add-section=.image=$(obj)/vmlinux.bin.z \
 			--set-section-flags=.image=contents,alloc,load,readonly,data
 $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
-- 
2.0.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v2 2/4] MIPS: zboot: Avoid useless rebuilds Alban Bedel <albeu@free.fr> - 2016-01-23 14:00 +0100

csiph-web