Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4085823ybz; Mon, 20 Apr 2020 15:28:45 -0700 (PDT) X-Google-Smtp-Source: APiQypKNdquUGW2zFakLaQCDZhtQ5IuOt0Xh+WpZ65epr8iLYRNCGR3GyAGBd4d9Su+I8hN4Gm9T X-Received: by 2002:a17:906:3e52:: with SMTP id t18mr17903153eji.204.1587421725598; Mon, 20 Apr 2020 15:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587421725; cv=none; d=google.com; s=arc-20160816; b=xex7swin9td6t1Xe8RMbNB/2YBb4xpEJNoiQSRTZ6J2NmoTYRmlAXdT7cNMRLRvjM6 Pi1FQwY2+ooVRVB6YlQ7Nm/b54PljO1zk2R18O/6vqdFn057e0AcwyiCM3taHtzNAV0z brMyY9OXzhWfHzo+IFdM/z54zaF35/vDRpD8WGXsybodeFHXh8HXygOlJmgbe0Ti0U+P j+UQtOH3+jobYDjJkk6RDUeEBbhGGhAAU4rJREorhj4wlPOK+hPcG81hJbiVS9jjcWIq kYmfA7e42CvzyV2leJKa5JssaHyZAQd+/KhN+XO+jfpw/OtUlrVUvP3dpHsoXp8fjYEe DtIw== 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:date:cc:to:from:subject :message-id:dkim-signature; bh=FnTnNFEg7Eu5eE5Hx3GU/Dpc3NxMHsYhRv+oF0x2HIU=; b=uduIQqjU6+SxYHlywaVZlbHXCPlv7h/YKQ38Oebzuwb1f4Q6Hi2g1QXNBx4hT6Vs1T ciECo8BYf+z38D9hE96ni75nGXkHVzuNyYo74fgVzAGS7qaZlZP65JxxkNOT+e4uchUu D2imSHPYc9dZbVx7f9PZaYm3oofd1+Jxz9imnsZZNRo0VGIQ97OZyxCCsZFnnFGQuGCu Ou82XPv0XPW42ihzeUZGHbhLQFuVZnf6rx65msWiMuW7LA9c0sQKZwpYUNmTwXKiSnXT vzZSxvFDyPMUPjXBXoaGeJ3BK4irGD4CamuylqVQL2EFKL2hJHGzv+VykqvO95eoEK6K NT8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@massaru-org.20150623.gappssmtp.com header.s=20150623 header.b=CuexACRM; 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 5si451192edx.30.2020.04.20.15.28.22; Mon, 20 Apr 2020 15:28:45 -0700 (PDT) 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=@massaru-org.20150623.gappssmtp.com header.s=20150623 header.b=CuexACRM; 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 S1727968AbgDTW1I (ORCPT + 99 others); Mon, 20 Apr 2020 18:27:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbgDTW1I (ORCPT ); Mon, 20 Apr 2020 18:27:08 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28BBCC061A0E for ; Mon, 20 Apr 2020 15:27:08 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id b62so12592524qkf.6 for ; Mon, 20 Apr 2020 15:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=massaru-org.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=FnTnNFEg7Eu5eE5Hx3GU/Dpc3NxMHsYhRv+oF0x2HIU=; b=CuexACRM/C7YEMKWw9T0KV9eEQVZc8QUsaRMUaeTFwVC1cxNRwOvGcF+3MHhGFJElL rKFypSJxXiymzlr+Puvh5wsRv8jVT59EXleHsAtvkBJKEPeVy/dTBxXDC83umNjZOKCV 2g4eALDgePL8EH/4+737PUzU3ZimD59H5a978UMEt/LAulA8eV1sZ+fzPjzFHw95WRoU ArZp4qpwzAw2g4gV9G4ZTpojWKjrxhHOB86qTEUaui57pW87Fi5+Sc7HDtyvdqm93I0P oy0NrFnMbya1fLltw+j51dTwjtxslYV1vngnIoR1JV6EcSbftzbB4S+S5mSdx7p1XzK1 PD/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=FnTnNFEg7Eu5eE5Hx3GU/Dpc3NxMHsYhRv+oF0x2HIU=; b=hH2cC3Ifvc49ngjufCdDMsPNXZtfM7U+OoruxVrcwzIqRMsLPgqsIg8F68OSrGS1mZ yVl4R+AsmxFrTyJVEMhzb5bN6AlR5fO4ZvvD4RMV6LoPfmQs94G3IISDTBD4wSt++vAP WyQB/UsPkzPqxbjS7mqxFpaMv9wf4dMzaTOteMoROCoMHbnJG/kaO4A+0LHh7p5ZeZZa f91maedWghJe703J6mrog6ED+EQ4uUxzNUxeUX2fZryRExE+g+qhjEgxVQYPEL7C+9EK SV/nw6kPuSoT4dayNC2Ywxg9k0BXPZ4t6nyJCTe8fVG3NeiQjPjw8YzAtOZzvu23t7Wh cGLQ== X-Gm-Message-State: AGi0PuZDwKHJYlbu34610hJ8tc3TdC/qvjmE2d+Y8pA2qJcr2VdekGEL jg8iCCycDdevIcZOt7n+zjmR/Q== X-Received: by 2002:a05:620a:b03:: with SMTP id t3mr18349178qkg.209.1587421627192; Mon, 20 Apr 2020 15:27:07 -0700 (PDT) Received: from bbking.lan ([2804:14c:4a5:36c::cd2]) by smtp.gmail.com with ESMTPSA id j2sm451758qth.57.2020.04.20.15.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 15:27:06 -0700 (PDT) Message-ID: Subject: Re: [PATCH v2] kbuild: ensure mrproper removes arch/$(SUBARCH)/include/generated/ From: Vitor Massaru Iha To: Masahiro Yamada Cc: Linux Kbuild mailing list , Michal Marek , Linux Kernel Mailing List , Brendan Higgins , Shuah Khan , "linux-kernel-mentees@lists.linuxfoundation.org" Date: Mon, 20 Apr 2020 19:27:03 -0300 In-Reply-To: References: <20200414012132.32721-1-vitor@massaru.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro, On Sat, 2020-04-18 at 03:12 +0900, Masahiro Yamada wrote: > Hi. > > On Tue, Apr 14, 2020 at 10:21 AM Vitor Massaru Iha > wrote: > > In the following use case, when compiling the kernel for the UML > > architecture, for example: > > > > * `make ARCH=um defconfig && make ARCH=um -j8`, > > > > SUBARCH files are generated, however when we run the command: > > > > * `mrproper ARCH=um` > > make ARCH=um mrproper > > > > the files `arch/$(SUBARCH)/include/generated/ aren't cleaned up. > > > > This generates compilation errors by running the following command: > > > > * `make ARCH=um defconfig O=./build_um && make ARCH=um -j8 > > O=./build_um` > > > > This PATCH fix that problem. > > This patch fixes ... > > > This makes it possible to compile on different architectures that > > use the > > SUBARCH variable, in different build directories and root directory > > of the > > linux directory. This is important because we can compile without > > the object > > files being overwritten. This reduces the re-compilation time in > > this use case. > > Sorry, I do not understand this paragraph. > > > Brendan Higgins just reported the build error > in the out-of-tree build after in-tree build. > > > [1] make ARCH=um defconfig all > [2] make ARCH=um mrproper > [3] make ARCH=um O=foo defconfig all > > -> build error > > Ins't it? > > > > > Besides that, in the workflow of developing unit tests, using > > kunit, and > > compiling in different architectures to develop or test a PATCH, > > this use case > > applies. > > > > * This bug was introduced in this commit a788b2ed81abe > > Instead, adding Fixes tag is the convention. > > Fixes: a788b2ed81ab ("kbuild: check arch/$(SRCARCH)/include/generated > before out-of-tree build") > > > > * Related bug: https://bugzilla.kernel.org/show_bug.cgi?id=205219 > > Maybe, this can be also a tag. > > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=205219 > > > > > > Signed-off-by: Vitor Massaru Iha > > Reported-by: Brendan Higgins Was actually Reported-by Theodore Ts'o https://groups.google.com/forum/#!msg/kunit-dev/QmA27YEgEgI/hvS1kiz2CwAJ > > > > > Reviewed-by: Brendan Higgins > > Tested-by: Brendan Higgins > > --- > > v2: > > * Explains what this PATCH does and the importance as suggested > > by Brendan Higgins. > > --- > > Makefile | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/Makefile b/Makefile > > index 70def4907036..e1a79796032e 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -532,7 +532,8 @@ outputmakefile: > > ifdef building_out_of_srctree > > $(Q)if [ -f $(srctree)/.config -o \ > > -d $(srctree)/include/config -o \ > > - -d $(srctree)/arch/$(SRCARCH)/include/generated ]; > > then \ > > + -d $(srctree)/arch/$(SRCARCH)/include/generated -o > > \ > > + -d $(srctree)/arch/$(SUBARCH)/include/generated ]; > > then \ > > This hunk is unneeded. > > > > > echo >&2 "***"; \ > > echo >&2 "*** The source tree is not clean, please > > run 'make$(if $(findstring command line, $(origin ARCH)), > > ARCH=$(ARCH)) mrproper'"; \ > > echo >&2 "*** in $(abs_srctree)";\ > > @@ -1388,6 +1389,7 @@ CLEAN_FILES += modules.builtin > > modules.builtin.modinfo modules.nsdeps > > # Directories & files removed with 'make mrproper' > > MRPROPER_DIRS += include/config include/generated \ > > arch/$(SRCARCH)/include/generated .tmp_objdiff \ > > + arch/$(SUBARCH)/include/generated \ > > debian/ snap/ tar-install/ > > MRPROPER_FILES += .config .config.old .version \ > > Module.symvers \ > > -- > > 2.25.1 > > > > This problem is only related to ARCH=um builds. > So, it should be fixed in arch/um/Makefile. > > > > > diff --git a/arch/um/Makefile b/arch/um/Makefile > index d2daa206872d..275f5ffdf6f0 100644 > --- a/arch/um/Makefile > +++ b/arch/um/Makefile > @@ -140,6 +140,7 @@ export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) > $(LD_FLAGS_CMDLINE) > # When cleaning we don't include .config, so we don't include > # TT or skas makefiles and don't clean skas_ptregs.h. > CLEAN_FILES += linux x.i gmon.out > +MRPROPER_DIRS += arch/$(SUBARCH)/include/generated Can I add suggested-by Masahiro Yamada ? > archclean: > @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ > > > > > > -- > Best Regards > Masahiro Yamada