From patchwork Fri Dec 7 11:33:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153146 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp386955ljp; Fri, 7 Dec 2018 03:34:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/UUtNe43mNjh/hKqscfhnF5Chj1XKRoqNgw5rPGz/ga4HErIqPBbG+zKwOphRtLWsr54vWN X-Received: by 2002:a17:902:48:: with SMTP id 66mr1772030pla.68.1544182480532; Fri, 07 Dec 2018 03:34:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544182480; cv=none; d=google.com; s=arc-20160816; b=qL+Tt5JRQ5t1FSt4NuP8lUwD6Qzp0ZQjoABGdGEmQJPMVSZneAvBNquLhFMRu96L79 mvyi1Ny/LR4poxMnvqzw6TjY3L7ECPiSGFus2/wEXWWF3BVaN2+YuSaltlHO4y1HKR5u CVHOpTTW95Wzh2q8TNQPvD/EAnlEUzoeZCdAjg/SpyVR19qRgnH78AqGcbM2xJY2MmMr av9D9NdEzGGGsTGKkxw3r4j39YNtf/My8s/hiD6gQbTXBfwd3eb2ndZJdSXcHKls8HGf gVI5RCO2FTtagxEzLA/EBtSmi5D7UNGkpsvhv73UtdaHkIsurvTVuUshr05/Ihn7GTdr ZJVw== 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 q9si2685750pgh.92.2018.12.07.03.34.40; Fri, 07 Dec 2018 03:34:40 -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 S1726169AbeLGLei (ORCPT + 31 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(-) -- 2.7.4 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)