Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp436650imu; Fri, 7 Dec 2018 03:36:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/XSNNBRjFeIOJvTwYofaQfXFKX+D9EKMKSLI+jkd49rjwjWu6ypkKyyaaedQQ4glDY4DVU1 X-Received: by 2002:a65:6684:: with SMTP id b4mr1633186pgw.55.1544182593855; Fri, 07 Dec 2018 03:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544182593; cv=none; d=google.com; s=arc-20160816; b=dfpX2LjT5JL3GeTXe/O0yn+VLdI7p9c1ts0pKGsXrJ1DQAvE8B6EZy2FqlPFQq/6r6 5sRIJgZRipljgVVu4k3EhXOw6rErVIVFOIALkmO8dW+0qDZj1y1G8QnKifII9Iog13gH 0H95GB2O5qZheeuuA7QREEx4f5pJljMNVTGOskIEV5U4bdaj2tI6+D2QScLc2MVh4qsB cCz1DsUR7PCf6mVVWi+RuFYdotRg1MOIpMqc86tkqydFV0lHXEvY6H8dYBk98lrE0EEx W9Pjn2o/PzXxTgEQ80oNGkTRYvMjc8EHU/vEYKzKrjAPM5lCaeNgAKTZzExYimVuOmSj R6zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=ivFgaDo0g7XPKa5r9gRej5aUPRGIiJLbRoRae7zdj6w=; b=tL1PbchX290YSIQdOStf5lKLfFFEWbX4Pkdvt5Mvl3C+eeqxseUCWEMvgym1SOLQxT aEpJa1t34rXkVHzrcuEDipGYgXlfrxo2WApw1bdE0EzQ/ws3uWA/BykXZn0LQQKmawAT Gcmcwj3XZS4JpsUYQzkE4IcK7eNQRILno3EN6wdBWglXZN1QU6noE+eVKUGdpCglNJzE 6Vahz7wP0Notn7e8rVsmrOAUvEYGi3L0RFc3uy6fJRamluvhpYwuylkhuG6OJiSwBB4i 6O7M3wIERLca7NAVmAErCjasg6uFSq37xlNGtYdM1TQxiR1+kVHDDs/7WDk55SV9VSwn cLUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JVTi2EUa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si2431647pgg.162.2018.12.07.03.36.18; Fri, 07 Dec 2018 03:36:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JVTi2EUa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726165AbeLGLei (ORCPT + 99 others); Fri, 7 Dec 2018 06:34:38 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:45833 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726140AbeLGLeg (ORCPT ); Fri, 7 Dec 2018 06:34:36 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id wB7BY6re020070; Fri, 7 Dec 2018 20:34:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com wB7BY6re020070 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544182448; bh=ivFgaDo0g7XPKa5r9gRej5aUPRGIiJLbRoRae7zdj6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JVTi2EUa+qQue5dSdxR0r6bNknXhq2MlEsinLwfDvJ72mot/DsKSAbEO14SxiH3Lx ADkhrCV0faPuAZNywAsznOP1vdIZwXLA+ku51bM4iXhAx6zBu2RosaQH5X7ZaFxI2e H3gMjpPQSjLjgQFFZAnctl5iTCcygCnkTpCnKa4oAzL9PZRAT/4CXoy/As2yGkfbUd PohOr0x3UoiSeJBIwxMNFGmNhMEYgv+PE/ZJ9A5C5Mlskwe8hmLWw2PoA+aMYXnWCx AM+oNObRrgCrbq8idw8p5wiKs+w4tplIgwOdZsZ8vvGsjSOYqmJ5m9k6/7bvg3aAL5 Q/1jFzEe5x4Lg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Michal Simek Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 3/6] microblaze: fix multiple bugs in arch/microblaze/boot/Makefile Date: Fri, 7 Dec 2018 20:33:54 +0900 Message-Id: <1544182437-26660-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544182437-26660-1-git-send-email-yamada.masahiro@socionext.com> References: <1544182437-26660-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit fixes some build issues. The first issue is the breakage of linux.bin.ub target since commit ece97f3a5fb5 ("microblaze: Fix simpleImage format generation") because the addition of UIMAGE_{IN,OUT} affected it. make ARCH=microblaze CROSS_COMPILE=microblaze-linux- linux.bin.ub [ snip ] OBJCOPY arch/microblaze/boot/linux.bin UIMAGE arch/microblaze/boot/linux.bin.ub.ub /usr/bin/mkimage: Can't open arch/microblaze/boot/linux.bin.ub: No such file or directory make[1]: *** [arch/microblaze/boot/Makefile;14: arch/microblaze/boot/linux.bin.ub] Error 1 make: *** [arch/microblaze/Makefile;83: linux.bin.ub] Error 2 The second issue is the use of the "if_changed" multiple times for the same target. As commit 92a4728608a8 ("x86/boot: Fix if_changed build flip/flop bug") pointed out, this never works properly. Moreover, generating multiple images as a side-effect is confusing. Let's split the build recipe for each image. simpleImage.
*.unstrip is just a copy of vmlinux. simpleImage.
and simpleImage.
.ub are created in the same way as linux.bin and linux.bin.ub, respectively. I kept simpleImage.* recipes independent of linux.bin.* ones to not change the behavior. Lastly, this commit fixes "make ARCH=microblaze clean". Previously, it only cleaned up the unstrip image. Now, all the simpleImage files are cleaned. Signed-off-by: Masahiro Yamada --- Changes in v2: - Squash the first patch into this - Separate simpleImage recipes from linux.bin* recipes arch/microblaze/Makefile | 2 +- arch/microblaze/boot/Makefile | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index 6cee1ca..ff5abbd 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile @@ -87,7 +87,7 @@ linux.bin linux.bin.gz linux.bin.ub: vmlinux @echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')' simpleImage.%: vmlinux - $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ + $(Q)$(MAKE) $(build)=$(boot) $(addprefix $(boot)/$@., ub unstrip strip) @echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')' define archhelp diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile index 96eefdc..cff570a 100644 --- a/arch/microblaze/boot/Makefile +++ b/arch/microblaze/boot/Makefile @@ -3,7 +3,7 @@ # arch/microblaze/boot/Makefile # -targets := linux.bin linux.bin.gz linux.bin.ub simpleImage.% +targets := linux.bin linux.bin.gz linux.bin.ub simpleImage.* OBJCOPYFLAGS := -R .note -R .comment -R .note.gnu.build-id -O binary @@ -16,21 +16,20 @@ $(obj)/linux.bin.ub: $(obj)/linux.bin FORCE $(obj)/linux.bin.gz: $(obj)/linux.bin FORCE $(call if_changed,gzip) -quiet_cmd_cp = CP $< $@$2 - cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) - quiet_cmd_strip = STRIP $< $@$2 cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \ -K _fdt_start $< -o $@$2 UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR) -UIMAGE_IN = $@ -UIMAGE_OUT = $@.ub -$(obj)/simpleImage.%: vmlinux FORCE - $(call if_changed,cp,.unstrip) +$(obj)/simpleImage.$(DTB): vmlinux FORCE $(call if_changed,objcopy) + +$(obj)/simpleImage.$(DTB).ub: $(obj)/simpleImage.$(DTB) FORCE $(call if_changed,uimage) - $(call if_changed,strip,.strip) -clean-files += simpleImage.*.unstrip linux.bin.ub +$(obj)/simpleImage.$(DTB).unstrip: vmlinux FORCE + $(call if_changed,shipped) + +$(obj)/simpleImage.$(DTB).strip: vmlinux FORCE + $(call if_changed,strip) -- 2.7.4