linux-mips
[Top] [All Lists]

[PATCH v2] MIPS: do not allow building vmlinuz when !ZBOOT

To: linux-mips@linux-mips.org
Subject: [PATCH v2] MIPS: do not allow building vmlinuz when !ZBOOT
From: "Florian Fainelli" <f.fainelli@gmail.com>
Date: Wed, 11 Sep 2013 11:34:48 +0100
Cc: ralf@linux-mips.org, blogic@openwrt.org, james.hogan@imgtec.com, richard@nod.at, "Florian Fainelli" <f.fainelli@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
When CONFIG_SYS_SUPPORTS_ZBOOT is not enabled, we will still try to
build the decompressor code in arch/mips/boot/compressed as a
dependency for producing the vmlinuz target and this will result in
the following build failure:

  OBJCOPY arch/mips/boot/compressed/vmlinux.bin
arch/mips/boot/compressed/decompress.c: In function 'decompress_kernel':
arch/mips/boot/compressed/decompress.c:105:2: error: implicit
declaration of function 'decompress'
make[1]: *** [arch/mips/boot/compressed/decompress.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [vmlinuz] Error 2

This is a genuine build failure because we have no implementation for
the decompress() function body since no kernel compression method
defined in CONFIG_KERNEL_(GZIP,BZIP2...) has been enabled.

arch/mips/Makefile already guards the install target for the "vmlinuz"
binary with a proper ifdef CONFIG_SYS_SUPPORTS_ZBOOT, we now also do the
same if we attempt to do a "make vmlinuz" and show that
CONFIG_SYS_SUPPORTS_ZBOOT is not enabled.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes since v1:
- rebased on top of James Hogan changes in mips-for-linux-next
- ensure that vmlinuz depends on FORCE
- use /bin/false to properly report an error

 arch/mips/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 75a36ad..55af9d7 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -305,10 +305,16 @@ $(boot-y): $(vmlinux-32) FORCE
        $(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) \
                $(bootvars-y) arch/mips/boot/$@
 
+ifdef CONFIG_SYS_SUPPORTS_ZBOOT
 # boot/compressed
 $(bootz-y): $(vmlinux-32) FORCE
        $(Q)$(MAKE) $(build)=arch/mips/boot/compressed \
                $(bootvars-y) 32bit-bfd=$(32bit-bfd) $@
+else
+vmlinuz: FORCE
+       @echo '   CONFIG_SYS_SUPPORTS_ZBOOT is not enabled'; \
+       /bin/false
+endif
 
 
 CLEAN_FILES += vmlinux.32 vmlinux.64
-- 
1.8.1.2



<Prev in Thread] Current Thread [Next in Thread>