From patchwork Tue Dec 3 22:32:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 180755 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2155166ile; Tue, 3 Dec 2019 14:49:39 -0800 (PST) X-Google-Smtp-Source: APXvYqw9XDOwC1oJ+IBa1UNpH08QAZ0rS01Q7INR96zdgVgWDhSIQBxFWhWDOpzdHPIZfVasWGzm X-Received: by 2002:a9d:22a8:: with SMTP id y37mr180869ota.359.1575413379892; Tue, 03 Dec 2019 14:49:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575413379; cv=none; d=google.com; s=arc-20160816; b=higduXR/2ow32un7zEUoM6h3Tv8WusOB3BUM+MF8ocyBOzdEdD2el/h20mKMMt3Cyh umtGNO9ABueOCCdhevvwFu4iFhig5aD2fgRlvchxMytEgRUaZrLOS9P1Ay8xCLcTFmUP 2Tr0pba3nMfQsxHrFPdIsDiTzMpqrGps1F3Npbho9JjfAySikDDeA396QRfjd889ySxL Hs9vsTyLaOR4zAGURwxvt4eV9xeOpuTfcELgx52av05LIgIoA7vFYrp+1Z9xAY4RVeO2 AZdZc78Z0XvCv3++ZyCZyh7hLQp1EkPS3heKdnNSZG5QIMZcsA9cfaTdsAnf8LeuCVcp w5nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RdQXFox+WdioE5vGr6+unl7pl9mPLvNCc28P/8bv8U8=; b=vdm2b4mSg8mb6zCGODrv+j1RaxJ6LGgCiRw2JYzk0vxcImGAhGxKWwbUnl3TcgLNLB ZK6Y+vrRabzQ5FMDWMJD6WZFtX6XCWm7UZOEkB3ZDi7WftAGycjSqxFxG7pghy6BTfy4 llfrXP3Y2ExxDJPjp321fcV9sJ+8GKKynYQSM3/hmhNmQYxE13i6mjaU5y/yYz66blF5 Fl14NaLalLm1iqwNAhDK+thKgiv+7Wa8sZ4lHR5JCGBjoh73F8BUe+opvMlXM4ucm/eK pfZOKlqm9xZ5eAh7EZ8JfRFaGz0OpW2YlcwkHgPs1YFiMTbnPAwSeJsYekKEdmL7AK9H 9AJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dh2nCtq3; 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 h9si2098427otb.49.2019.12.03.14.49.39; Tue, 03 Dec 2019 14:49:39 -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=@kernel.org header.s=default header.b=dh2nCtq3; 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 S1729638AbfLCWti (ORCPT + 27 others); Tue, 3 Dec 2019 17:49:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:40754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729392AbfLCWth (ORCPT ); Tue, 3 Dec 2019 17:49:37 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F5EC20803; Tue, 3 Dec 2019 22:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413376; bh=IJ+0jeSZb9ortcdzj9j4dxSaRyrGAGfxWZNhRfCNZIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dh2nCtq3NxkcF2T+P8bBJ3pskQphlxfTiHfPSa2H06pvBIUjw0Fb3da2Bpadzcd4g rtQhDfqGIuHFrJsKYT1xFRWEbdPqt1XAsFhz5b2MX/VrYYgKdVtu1aBPxQFtkCndyS b6iPwwvInXhrKpSKIob8ZyiU8bU+SEeUp1Iz4Xww= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Michal Simek , Sasha Levin Subject: [PATCH 4.19 104/321] microblaze: fix multiple bugs in arch/microblaze/boot/Makefile Date: Tue, 3 Dec 2019 23:32:50 +0100 Message-Id: <20191203223432.564066598@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 4722a3e6b716d9d4594c3cf3856b03bbd24a59a8 ] 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 Signed-off-by: Michal Simek Signed-off-by: Sasha Levin --- arch/microblaze/Makefile | 2 +- arch/microblaze/boot/Makefile | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) -- 2.20.1 diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index b9808ddaf985f..548bac6c60f8c 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile @@ -86,7 +86,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 96eefdca0d9b3..cff570a719461 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)