From patchwork Mon Oct 7 20:03:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 2998981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4056BBF924 for ; Mon, 7 Oct 2013 20:03:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D29CD20211 for ; Mon, 7 Oct 2013 20:03:49 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4ABC32020F for ; Mon, 7 Oct 2013 20:03:48 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTH1r-0007up-R9; Mon, 07 Oct 2013 20:03:43 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTH1p-0008O6-HE; Mon, 07 Oct 2013 20:03:41 +0000 Received: from smtp.codeaurora.org ([198.145.11.231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTH1m-0008Ng-Io for linux-arm-kernel@lists.infradead.org; Mon, 07 Oct 2013 20:03:39 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 479DF13EF6B; Mon, 7 Oct 2013 20:03:14 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 3788F13F28D; Mon, 7 Oct 2013 20:03:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from [10.46.166.8] (i-global252.qualcomm.com [199.106.103.252]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A74AA13EF6B; Mon, 7 Oct 2013 20:03:13 +0000 (UTC) Message-ID: <52531381.8070607@codeaurora.org> Date: Mon, 07 Oct 2013 13:03:13 -0700 From: Stephen Boyd User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Russell King - ARM Linux Subject: Re: Bug: kbuild always rebuilds compressed images on ARM References: <20131005131706.GY12758@n2100.arm.linux.org.uk> In-Reply-To: <20131005131706.GY12758@n2100.arm.linux.org.uk> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131007_160338_779779_55A0EAFE X-CRM114-Status: GOOD ( 20.20 ) X-Spam-Score: -2.1 (--) Cc: linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 10/05/13 06:17, Russell King - ARM Linux wrote: > Hi, > > I've noticed that kbuild always rebuilds the compressed piggy image > on ARM. Here's the output from running make with V=2: > > CALL /home/rmk/git/linux-rmk/scripts/checksyscalls.sh - due to target missing > CHK include/generated/compile.h > Kernel: arch/arm/boot/Image is ready > Building modules, stage 2. > LZO arch/arm/boot/compressed/piggy.lzo - due to command line change > MODPOST 17 modules - due to target is PHONY > AS arch/arm/boot/compressed/piggy.lzo.o - due to: arch/arm/boot/compressed/piggy.lzo > LD arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/piggy.lzo.o > OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux > Kernel: arch/arm/boot/zImage is ready > > and with V=1: > > ... > make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=arch/arm/boot/compressed arch/arm/boot/compressed/vmlinux > make -f /home/rmk/git/linux-rmk/scripts/Makefile.modpost > find .tmp_versions -name '*.mod' | xargs -r grep -h '\.ko$' | sort -u | sed 's/\.ko$/.o/' | scripts/mod/modpost -m -a -o /home/rmk/git/build/imx6/Module.symvers -S -s -T - > (cat arch/arm/boot/compressed/../Image | lzop -9 && printf \\010\\224\\034\\002) > arch/arm/boot/compressed/piggy.lzo || (rm -f arch/arm/boot/compressed/piggy.lzo ; false) There are double slashes here '\\' > make -f /home/rmk/git/linux-rmk/scripts/Makefile.fwinst obj=firmware __fw_modbuild > ... > > The arch/arm/boot/compressed/.piggy.lzo.cmd file contains this: > > cmd_arch/arm/boot/compressed/piggy.lzo := (cat arch/arm/boot/compressed/../Image | lzop -9 && printf \\\\010\\\\224\\\\034\\\\002) > arch/arm/boot/compressed/piggy.lzo || (rm -f arch/arm/boot/compressed/piggy.lzo ; false) But then there are quadruple slashes here '\\\\'. That seems to be causing kbuild to rebuild each time. > > Any ideas why it thinks that the command has changed? This hack seems to work, but I'm not convinced it's the right solution. diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 547e15d..bfc0b79 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -209,7 +209,7 @@ endif # >$< substitution to preserve $ when reloading .cmd file # note: when using inline perl scripts [perl -e '...$$t=1;...'] # in $(cmd_xxx) double $$ your perl vars -make-cmd = $(subst \\,\\\\,$(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1)))))) +make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1))))) # Find any prerequisites that is newer than target or that does not exist. # PHONY targets skipped in both cases.