Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2393514pxb; Sat, 27 Feb 2021 23:06:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6XhYP4NybbFJXSLX4rYrOPyONdHfi2oWgSrRJWKZtj63uuJtx7tdTq2H62S/bUf2TwLzd X-Received: by 2002:a17:906:7d7:: with SMTP id m23mr10717976ejc.205.1614496016878; Sat, 27 Feb 2021 23:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614496016; cv=none; d=google.com; s=arc-20160816; b=U3VFS90U6Afn6yR1f5kKu4eqCWXuJUKKloChpJxQx4ee8RlEXQEiz8zTB3wbGgQQR/ eNgkkzf//O7BN3Ofej+fEurHjWnsy0Zumqh3ZTBuC5k8qtzqiOO7t2P+wb0q/gy/Jrjb iktyleKYrIElS/prrQG43ahwHbQsHPSa5DP/2Wf4kXuKFAZiNouSfAeaphHMvCUCp+K9 fOX8xrweNfaVBCyyE8W2qGR3j7UauCZ/5toVWOCGoczJrodASPzLnf+5BNzhkxUps72s DVM9usLjvSqyX2KdM4b1gL+PePlnnaMIhdQeaf1yS0wTcCy8Bv6npORZKXP9DHfpmbcX 3xVA== 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=tv5SDnKyPgoNP6YiEnF6vKsgSgqKofgv5GPg1jxlWHo=; b=jyrDGXKC5w9E/m5o1bmA+4XMFLYLHP9//2LacM2i4kRrlbAS0Bdycde1wX/SPoGUxw Aa9aYjC2rJUJMdXLK9Ftu1TKeugI7eEpTuy7XT3NpJ0mMp+rll8uzzWMwN4X7Vh0Ta/7 Srvc4922+b3Zn0cx1gXEFmm2QyjyVtrXtWI6pJ1mnRZu+YX7SbaEQzax/IQICB8ogH1B E4vsibo9RWOeTQhO939SQ+8SuWj28lM90gBrmeMw/9iKdATDakCQ6+iz8JSSt5mKwWK3 Ow5TDGEa/TCoQWxFkZxBvF7onJnpxLXgYabDzDbdAXhKgTt5pACX3FTjU29DbfJh9jTQ 2/1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=AqYiemIQ; 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 cc10si9828204edb.153.2021.02.27.23.06.34; Sat, 27 Feb 2021 23:06:56 -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=AqYiemIQ; 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 S230213AbhB1HEu (ORCPT + 99 others); Sun, 28 Feb 2021 02:04:50 -0500 Received: from conssluserg-01.nifty.com ([210.131.2.80]:29690 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbhB1HE2 (ORCPT ); Sun, 28 Feb 2021 02:04:28 -0500 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 11S70lE9021634; Sun, 28 Feb 2021 16:00:47 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 11S70lE9021634 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1614495647; bh=tv5SDnKyPgoNP6YiEnF6vKsgSgqKofgv5GPg1jxlWHo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AqYiemIQdGS7+6qTzFRIOsa0vrTOnXKmqd8bP2egk3+fLmNTxpD6rDl60wZ566qNx whxufXp3wD3ru3jgdraO2wf7HUhzuaTtt1eP1b+jz+qdAtnHC16FylwiDMT091YgkP 08x4SZPthTdZp3D/l1vHMWPFqNVU1ev7EV56RrcZCXg46xKegocZqc3aHpkDJ83u3r BWo9veP1HTNPgpPc+/uPHjdyLJI5vfabEOInD3PZ6SdlwvvAms1M2TjJr8f3idb3ja oGG1AMcUToNexOOkMoNMalzyv/ByktPBJ70CF8uldRNItyG5/LtFEW4OTs+bOxV87R bHx+jmvV1xupg== X-Nifty-SrcIP: [209.85.216.54] Received: by mail-pj1-f54.google.com with SMTP id t9so8489068pjl.5; Sat, 27 Feb 2021 23:00:47 -0800 (PST) X-Gm-Message-State: AOAM533SbQyiqVuIbka3PalnV1zCWAP39Ql/xyadtoxaMazZA0TWD5s2 VWwrYsdQMT055e0NYKH+kluA8HZkHvNJdoM7RBU= X-Received: by 2002:a17:90a:3b0e:: with SMTP id d14mr1565162pjc.198.1614495646276; Sat, 27 Feb 2021 23:00:46 -0800 (PST) MIME-Version: 1.0 References: <20210228061028.239459-1-masahiroy@kernel.org> <20210228061028.239459-4-masahiroy@kernel.org> In-Reply-To: <20210228061028.239459-4-masahiroy@kernel.org> From: Masahiro Yamada Date: Sun, 28 Feb 2021 16:00:09 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/4] kbuild: include Makefile.compiler only when compiler is required To: Linux Kbuild mailing list Cc: Linux Kernel Mailing List , Michal Marek , Israel Tsadok Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 28, 2021 at 3:10 PM Masahiro Yamada wrote: > > Since commit f2f02ebd8f38 ("kbuild: improve cc-option to clean up all > temporary files"), running 'make kernelversion' in a read-only source > tree emits a bunch of warnings: > > mkdir: cannot create directory '.tmp_12345': Permission denied > > Non-build targets such as kernelversion, clean, help, etc. do not > need to evaluate $(call cc-option,) and friends. Do not include > Makefile.compiler so $(call cc-option,) becomes no-op. > > This not only fix the warnings, but also runs non-build targets much > faster. > > Basically, all installation targets should also be non-build targets. > Unfortunately, vdso_install requires the compiler because it builds > vdso before installtion. This is a problem that must be fixed by a > separate patch. > > Signed-off-by: Masahiro Yamada > --- > > I am not adding Reported-by for now because a reporter sent me > an email privately. > > If he allows me to add Reported-by, I will add it to record > the credit. > > (Perhaps, another person might have reported a similar issue > somewhere, but my memory is obsure. I cannot recall it.) > Now, I got acknowledge to add this: Reported-by: Israel Tsadok > Makefile | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/Makefile b/Makefile > index eec7a94f5c33..20724711dc71 100644 > --- a/Makefile > +++ b/Makefile > @@ -263,6 +263,10 @@ no-dot-config-targets := $(clean-targets) \ > $(version_h) headers headers_% archheaders archscripts \ > %asm-generic kernelversion %src-pkg dt_binding_check \ > outputmakefile > +# Installation targets should not require compiler. Unfortunately, vdso_install > +# is an exception where build artifacts may be updated. This must be fixed. > +no-compiler-targets := $(no-dot-config-targets) install dtbs_install \ > + headers_install modules_install kernelrelease image_name > no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease \ > image_name > single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/ > @@ -270,6 +274,7 @@ single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/ > config-build := > mixed-build := > need-config := 1 > +need-compiler := 1 > may-sync-config := 1 > single-build := > > @@ -279,6 +284,12 @@ ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) > endif > endif > > +ifneq ($(filter $(no-compiler-targets), $(MAKECMDGOALS)),) > + ifeq ($(filter-out $(no-compiler-targets), $(MAKECMDGOALS)),) > + need-compiler := > + endif > +endif > + > ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),) > ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),) > may-sync-config := > @@ -584,7 +595,9 @@ endif > > # Include this also for config targets because some architectures need > # cc-cross-prefix to determine CROSS_COMPILE. > +ifdef need-compiler > include $(srctree)/scripts/Makefile.compiler > +endif > > ifdef config-build > # =========================================================================== > -- > 2.27.0 > -- Best Regards Masahiro Yamada