Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1341528pxb; Sun, 17 Jan 2021 05:38:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSBpdMA1Sqx3IFZnRFcKEsvmDVMAOe47MgsGe3rOsV9kOJ7cg6wsq77kf7WocL1XKPNjT3 X-Received: by 2002:a50:8b66:: with SMTP id l93mr15516083edl.384.1610890684724; Sun, 17 Jan 2021 05:38:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610890684; cv=none; d=google.com; s=arc-20160816; b=NuxJYAr2ftFI/WeFNGBU9nj6B0syhGR2Dr8jkOnmj91P9kC181r92DEIi7ijN+pgfA CKgLgIz2ZtevbHKBLXUU9rB6C3EwWndVSEtxKEJ37CpDIclDO5LN92ls1jU+lSmtEBLt 6FB/MMBUQpDQ8r+ecX56qHKKVWoBsG3MmeD4VBGnHhwmI0v1d6v2FSGeVFZSLI3fLaZN BqNMKdZyPzap3YLbqRHgwL3k/jTueGGmVUokk3I7NvJJPcKbDNrxs5hXDT4YwZajy7fH g1lsyhARfNXgzIurZEAnRBewz/uua//Qg97xOxC7fCGpYu73vgTL2stIZJd/cV2yVFQx Kkgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=4JcxKvQC6APWHiCwSaq63XvVH6wTzBfByF3665mn2t0=; b=uKzbF0RsW3h675dsYd9S6H6A1vOS7uNZykBop+rRxbSegch+VG2zzzGdXwH89YqUUS IyQY8XSWrbVL1KuvRtC+REDlLg+4GTfQPMdiv+YyDS7gCI5izY5pILW7/feJMNrO9M0l K1/yjrx+C7psI2ojt5b0ezKWD0ibO9z7TqMQEYaJt7iZZTpkTAQfh9mCUhdbA2DonHvW 5R7zNwAJGGR/j7LRRxyCkv28Dsa8GqbP03vtTHf5h9fH2mPRgkaKxQVgdB+ozpTESFuw rY789XN6Q1KsbZnclVmjWM4H31V9G1BPCxJC6VCrdQkxilR0jzs1SyZtHDa0iCJQeDbs kjPA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si3972943eja.449.2021.01.17.05.37.40; Sun, 17 Jan 2021 05:38:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728452AbhAQNfe (ORCPT + 99 others); Sun, 17 Jan 2021 08:35:34 -0500 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:57017 "EHLO outpost1.zedat.fu-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727626AbhAQNfa (ORCPT ); Sun, 17 Jan 2021 08:35:30 -0500 Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.94) with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1l18CX-001lW6-UU; Sun, 17 Jan 2021 14:34:41 +0100 Received: from dynamic-077-011-224-154.77.11.pool.telefonica.de ([77.11.224.154] helo=[192.168.1.10]) by inpost2.zedat.fu-berlin.de (Exim 4.94) with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (envelope-from ) id 1l18CX-0029kd-7L; Sun, 17 Jan 2021 14:34:41 +0100 Subject: Re: [PATCH 2/2] sh: boot: avoid unneeded rebuilds under arch/sh/boot/compressed/ To: Masahiro Yamada , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Cc: Arnd Bergmann , Brendan Higgins , Greg Kroah-Hartman , Russell King , "Steven Rostedt (VMware)" , linux-kernel@vger.kernel.org References: <20210117111632.2392635-1-masahiroy@kernel.org> <20210117111632.2392635-2-masahiroy@kernel.org> From: John Paul Adrian Glaubitz Message-ID: Date: Sun, 17 Jan 2021 14:34:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210117111632.2392635-2-masahiroy@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 77.11.224.154 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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