Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1425299pxb; Sun, 17 Jan 2021 08:25:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/Mauh1208IJ0ALTbD+E6wuDmZtN/HTcEYohmzWIa03cH6s1zD+OyOZhh4sTLfdp24Ki+v X-Received: by 2002:a50:e882:: with SMTP id f2mr15971304edn.76.1610900726985; Sun, 17 Jan 2021 08:25:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610900726; cv=none; d=google.com; s=arc-20160816; b=IUKhAJDGFFhnkuSYTR1f+TidPUhRZSONRogCa34KakvdCqL8ZV2Uj3NpyeYnYkS3Qz wbDxLy1spxZ/s2Y52lUFOCtB+YIvtJHED8y51/TmOxQKq1+lsAkaAG7aeFFgz9CnVPkK w4CRDey2kDJgNKvaeEM2UaFIXPX5vUCD4ixVBiay/TBLYsQN50WKisuPSdUlG5UwPWLW hD7g+wfjWhSMQBZLe1KBMsJogi3ZXWa1WzwGCDp0VJqOGDRzg5YXHMpUmNgA8yqzBMum hGyKAaC7WvFpoBNcBeJY1m2E41ZHjU3fx2xOaMFJSbdX/LFLQBFOXr+aTDSLdnc4h8hL sgNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=A96ILU3TUGfDLP2inrPNigj9gcgMcZK1odLxYlprZk0=; b=wgF7Ejs7U3AQvA7ofcQ0j28i466J0JDLvkKpEm8dDLM7R0XPZxjY40Qkh8DcZAXLnN nwJ6QdZpgCMjsbVWLQeQanu3Yg9c7IQlLfIUJh0SQ1BPzFd6EjbOXERZ/6FlkYsCYPPb 7tDcm1f3mJKWF9CsnKLIrVRRLpbMuSt/ZjH1d5a0LqLCa1KuAuvPAJYvWzMB832m2lJq h0kWDx4dCGMZ8SOvL+Ks+bpe49J+4UqHstWe3Qpa65LVFhehb5YMJ7CdGzsQfjlnnM9N 2u8+b2JDMUQ2nFlGi92nZbOSTJAEsOjplLGbWFALLbWaDFmeq1WWXAuC+9rI8K1vsRxf D7mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=HdzKoqWv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t24si911739ejr.255.2021.01.17.08.25.02; Sun, 17 Jan 2021 08:25:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=HdzKoqWv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729569AbhAQQXI (ORCPT + 99 others); Sun, 17 Jan 2021 11:23:08 -0500 Received: from conssluserg-02.nifty.com ([210.131.2.81]:42484 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728693AbhAQQXF (ORCPT ); Sun, 17 Jan 2021 11:23:05 -0500 X-Greylist: delayed 18304 seconds by postgrey-1.27 at vger.kernel.org; Sun, 17 Jan 2021 11:23:03 EST Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 10HGLo8D030649; Mon, 18 Jan 2021 01:21:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 10HGLo8D030649 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1610900511; bh=A96ILU3TUGfDLP2inrPNigj9gcgMcZK1odLxYlprZk0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HdzKoqWvcD9A63HAU4U/oBjM4rWPhjpaE+lKlxEgdsQKNlch4H50LPNHRHYBBEWG6 i+Q61TjrUuFlVjRenV6xR6mZFZEdLsGXtFuLGgr39KMAInFJtG/iatSVU7aicnem2U cysy5/WRNOlGjwk9IPqyJNEGlZ3wvjPIslnF7AWA5XgQfVtFG/c560Zmf2i7XPYx45 1iHhzxk/+pkx1tofeXWnPgLu/mm5iIZc4viLzS4/sF+GziByzSXOyAvK3IgA/lESVF g2FB17dPLeqTDKI9dS5HLOofnyda9ih8OBFkw5esdYPTHmmrjavUZjU94JBbu4CNtV /EbSxOi1I70Kg== X-Nifty-SrcIP: [209.85.215.177] Received: by mail-pg1-f177.google.com with SMTP id n25so9423676pgb.0; Sun, 17 Jan 2021 08:21:50 -0800 (PST) X-Gm-Message-State: AOAM533RvpKZ2ajjH8UpMBh/ELuWpY+jGqvdfAhlBFwoEq5a4l+fq3kY uDzEONf8MoCuXB5zZTNcTUFz5kalHBCQuBw6854= X-Received: by 2002:a62:820d:0:b029:1ad:d810:6805 with SMTP id w13-20020a62820d0000b02901add8106805mr22536477pfd.63.1610900509742; Sun, 17 Jan 2021 08:21:49 -0800 (PST) MIME-Version: 1.0 References: <20210117111632.2392635-1-masahiroy@kernel.org> <20210117111632.2392635-2-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Mon, 18 Jan 2021 01:21:13 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] sh: boot: avoid unneeded rebuilds under arch/sh/boot/compressed/ To: John Paul Adrian Glaubitz Cc: Yoshinori Sato , Rich Felker , Linux-sh list , Arnd Bergmann , Brendan Higgins , Greg Kroah-Hartman , Russell King , "Steven Rostedt (VMware)" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 17, 2021 at 10:35 PM John Paul Adrian Glaubitz wrote: > > Hi Masahiro! > > On 1/17/21 12:16 PM, Masahiro Yamada wrote: > > Even if none of source code is updated, the following are every time > > rebuilt: > > > > CC arch/sh/boot/compressed/cache.o > > SHIPPED arch/sh/boot/compressed/ashiftrt.S > > AS arch/sh/boot/compressed/ashiftrt.o > > SHIPPED arch/sh/boot/compressed/ashldi3.c > > CC arch/sh/boot/compressed/ashldi3.o > > SHIPPED arch/sh/boot/compressed/ashrsi3.S > > AS arch/sh/boot/compressed/ashrsi3.o > > SHIPPED arch/sh/boot/compressed/ashlsi3.S > > AS arch/sh/boot/compressed/ashlsi3.o > > SHIPPED arch/sh/boot/compressed/lshrsi3.S > > AS arch/sh/boot/compressed/lshrsi3.o > > LD arch/sh/boot/compressed/vmlinux > > OBJCOPY arch/sh/boot/zImage > > > > Add build artifacts to 'targets' as needed. > > > > I turned the library files to check-in files. It is simpler than > > copying from arch/sh/lib/ at build-time. > > > > Signed-off-by: Masahiro Yamada > > --- > > > > arch/sh/boot/compressed/.gitignore | 5 ----- > > arch/sh/boot/compressed/Makefile | 32 ++++++++++++------------------ > > arch/sh/boot/compressed/ashiftrt.S | 2 ++ > > arch/sh/boot/compressed/ashldi3.c | 2 ++ > > arch/sh/boot/compressed/ashlsi3.S | 2 ++ > > arch/sh/boot/compressed/ashrsi3.S | 2 ++ > > arch/sh/boot/compressed/lshrsi3.S | 2 ++ > > 7 files changed, 23 insertions(+), 24 deletions(-) > > create mode 100644 arch/sh/boot/compressed/ashiftrt.S > > create mode 100644 arch/sh/boot/compressed/ashldi3.c > > create mode 100644 arch/sh/boot/compressed/ashlsi3.S > > create mode 100644 arch/sh/boot/compressed/ashrsi3.S > > create mode 100644 arch/sh/boot/compressed/lshrsi3.S > > > > diff --git a/arch/sh/boot/compressed/.gitignore b/arch/sh/boot/compressed/.gitignore > > index 37aa53057369..cd16663bc7c8 100644 > > --- a/arch/sh/boot/compressed/.gitignore > > +++ b/arch/sh/boot/compressed/.gitignore > > @@ -1,7 +1,2 @@ > > # SPDX-License-Identifier: GPL-2.0-only > > -ashiftrt.S > > -ashldi3.c > > -ashlsi3.S > > -ashrsi3.S > > -lshrsi3.S > > vmlinux.bin.* > > diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile > > index 589d2d8a573d..cf3174df7859 100644 > > --- a/arch/sh/boot/compressed/Makefile > > +++ b/arch/sh/boot/compressed/Makefile > > @@ -5,12 +5,18 @@ > > # create a compressed vmlinux image from the original vmlinux > > # > > > > -targets := vmlinux vmlinux.bin vmlinux.bin.gz \ > > - vmlinux.bin.bz2 vmlinux.bin.lzma \ > > - vmlinux.bin.xz vmlinux.bin.lzo \ > > - head_32.o misc.o piggy.o > > +OBJECTS := head_32.o misc.o cache.o piggy.o \ > > + ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o > > + > > +# These were previously generated files. When you are building the kernel > > +# with O=, make sure to remove the stale files in the output tree. Otherwise, > > +# the build system wrongly compiles the stale ones. > > +ifdef building_out_of_srctree > > +$(shell rm -f $(addprefix $(obj)/, ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S)) > > +endif > > > > -OBJECTS = $(obj)/head_32.o $(obj)/misc.o $(obj)/cache.o > > +targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \ > > + vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo $(OBJECTS) > > > > GCOV_PROFILE := n > > > > @@ -33,21 +39,9 @@ ccflags-remove-$(CONFIG_MCOUNT) += -pg > > LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \ > > -T $(obj)/../../kernel/vmlinux.lds > > > > -# > > -# Pull in the necessary libgcc bits from the in-kernel implementation. > > -# > > -lib1funcs-y := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S > > -lib1funcs-obj := \ > > - $(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y)))) > > - > > -lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib > > - > > -KBUILD_CFLAGS += -I$(lib1funcs-dir) -DDISABLE_BRANCH_PROFILING > > - > > -$(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE > > - $(call cmd,shipped) > > +KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING > > > > -$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE > > +$(obj)/vmlinux: $(addprefix $(obj)/, $(OBJECTS)) FORCE > > $(call if_changed,ld) > > > > $(obj)/vmlinux.bin: vmlinux FORCE > > diff --git a/arch/sh/boot/compressed/ashiftrt.S b/arch/sh/boot/compressed/ashiftrt.S > > new file mode 100644 > > index 000000000000..0f3b291a3f4b > > --- /dev/null > > +++ b/arch/sh/boot/compressed/ashiftrt.S > > @@ -0,0 +1,2 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +#include "../../lib/ashiftrt.S" > > diff --git a/arch/sh/boot/compressed/ashldi3.c b/arch/sh/boot/compressed/ashldi3.c > > new file mode 100644 > > index 000000000000..7cebd646df83 > > --- /dev/null > > +++ b/arch/sh/boot/compressed/ashldi3.c > > @@ -0,0 +1,2 @@ > > +// SPDX-License-Identifier: GPL-2.0-only > > +#include "../../lib/ashldi3.c" > > diff --git a/arch/sh/boot/compressed/ashlsi3.S b/arch/sh/boot/compressed/ashlsi3.S > > new file mode 100644 > > index 000000000000..e354262b275f > > --- /dev/null > > +++ b/arch/sh/boot/compressed/ashlsi3.S > > @@ -0,0 +1,2 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +#include "../../lib/ashlsi3.S" > > diff --git a/arch/sh/boot/compressed/ashrsi3.S b/arch/sh/boot/compressed/ashrsi3.S > > new file mode 100644 > > index 000000000000..e564be9a4dcd > > --- /dev/null > > +++ b/arch/sh/boot/compressed/ashrsi3.S > > @@ -0,0 +1,2 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +#include "../../lib/ashrsi3.S" > > diff --git a/arch/sh/boot/compressed/lshrsi3.S b/arch/sh/boot/compressed/lshrsi3.S > > new file mode 100644 > > index 000000000000..5a8281b7e516 > > --- /dev/null > > +++ b/arch/sh/boot/compressed/lshrsi3.S > > @@ -0,0 +1,2 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +#include "../../lib/lshrsi3.S" > > This patch doesn't apply for me while the first one applies without problems: > > glaubitz@epyc:..glaubitz/linux-git> git am ../sh-patches-2021/\[PATCH\ 1_2\]\ sh\:\ boot\:\ add\ intermediate\ vmlinux.bin\*\ to\ targets\ instead\ of\ extra-y.eml > Applying: sh: boot: add intermediate vmlinux.bin* to targets instead of extra-y > glaubitz@epyc:..glaubitz/linux-git> git am ../sh-patches-2021/\[PATCH\ 2_2\]\ sh\:\ boot\:\ avoid\ unneeded\ rebuilds\ under\ arch_sh_boot_compressed_.eml > Applying: sh: boot: avoid unneeded rebuilds under arch/sh/boot/compressed/ > error: arch/sh/boot/compressed/ashiftrt.S: already exists in working directory > error: arch/sh/boot/compressed/ashldi3.c: already exists in working directory > error: arch/sh/boot/compressed/ashlsi3.S: already exists in working directory > error: arch/sh/boot/compressed/ashrsi3.S: already exists in working directory > error: arch/sh/boot/compressed/lshrsi3.S: already exists in working directory Adrian, these 5 files are currently generated files. That is why git-am failed. They are not cleaned up by 'make ARCH=sh clean' (this is a bug too). Please remove them manually, then try git am again. > Patch failed at 0001 sh: boot: avoid unneeded rebuilds under arch/sh/boot/compressed/ > hint: Use 'git am --show-current-patch=diff' to see the failed patch > When you have resolved this problem, run "git am --continue". > If you prefer to skip this patch, run "git am --skip" instead. > To restore the original branch and stop patching, run "git am --abort". > glaubitz@epyc:..glaubitz/linux-git> > > Adrian > > -- > .''`. John Paul Adrian Glaubitz > : :' : Debian Developer - glaubitz@debian.org > `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 > -- Best Regards Masahiro Yamada