Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2373949pxb; Sat, 27 Feb 2021 22:17:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaFpMydgLucPafYEYhV9R0Xo42JRbc5g4AFR+/oYhiTGWzNu9u5cjfyYH7DZRs0JRMVsHF X-Received: by 2002:a17:906:2dc1:: with SMTP id h1mr7376277eji.460.1614493033400; Sat, 27 Feb 2021 22:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614493033; cv=none; d=google.com; s=arc-20160816; b=SpF4cBQoUYjh7Kh5wyibaNK+lvrj2aQAt2Tc/oNCMmcqeh0H9cizKXurNwV4c4/FN1 6NqXDi7fVmVj6diELQHKXAqGna2TRcVEy1DbeMcrFl7EZf7RdoDglv0wXS2/QkJTIhr/ 6AUqybvwKONGPV435Qo3gyQvP4K4wZ42jvKGJ8AYkUw90NE+7ZcUrQOnErJNh8MtaJHH oEwTiOZbNs3HyrXdbyRv1tvAwjkIK6Ge3Hl4KTY0+rfz6N5Uajj+40oSMeci6/W5ZzDE RpSG5REZKIf/ef1Vf6TK/4g8WBdoTsNmbt2fpe8KzAOB8WFdb1h0Z+3jvBpk7L2oKBdA KBpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=wFJmglFoEgW+JEoX5Ob1iT5jv3nE+Vz/BGorJFXpFlQ=; b=yVGJLPeI5sqpJbReH9ygPGD1vqXhAx7A9XI6/LUo64Gn98HR6atXqZ9YJ8J7pwqWfP fmYnBdf5+UZFJ/Hmq5r3xq2OWiH9IUZk3mgjSrS7MuJrfaS2HPhjva5yDe3IpLDXdxs0 BigvzvO+JpandbhBSXrjhALZLKUaJjiKi/KXw86nz3dnJ+iwD9SHY6K0/TzxfF26zwpG 3JfmdNIs00XqSiM/c+zti9sLVP0ulZl6XV5YZgnH0m3/C+RI1wcc/67MdMQXJXx47isb 7afZ6idoLh9O4C6QApVcC+PyfZUBWJYjXRzppLh4rAV1NPnAo7Ggipb8aUJ1z9Nogl8Z QC0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=kMvjtPYa; 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 gr12si4653152ejb.306.2021.02.27.22.16.51; Sat, 27 Feb 2021 22:17:13 -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=kMvjtPYa; 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 S230203AbhB1GLt (ORCPT + 99 others); Sun, 28 Feb 2021 01:11:49 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:55342 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbhB1GLp (ORCPT ); Sun, 28 Feb 2021 01:11:45 -0500 Received: from oscar.flets-west.jp (softbank126026090165.bbtec.net [126.26.90.165]) (authenticated) by conuserg-07.nifty.com with ESMTP id 11S6Aagu009638; Sun, 28 Feb 2021 15:10:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com 11S6Aagu009638 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1614492638; bh=wFJmglFoEgW+JEoX5Ob1iT5jv3nE+Vz/BGorJFXpFlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kMvjtPYaDJ63B6Q0ElakJfGu9jywC7hvm+/lcNi9H+GtXV2g1OObL/rmuJHB19UxC atCn9fMTdr9jNirZXBU09uKjd8AVc1WuojPA1UvhToQBZdG7wHrZZI/XdJ+Yn1I5gN juDofy0mLCPBdelV67wUT9baEdcooNTyrJLixsrhn1KMUiupaECy8ZE4l+n+JSij7j x9t/SbWmrEjKSrA17JV9IA0pSG3zNZFfAF03G0Qvur2oGtXCl2ypRw1MrDqqfujiUA RxXiAD0gOxirqhfYRNRWOOkkSYvp4ykdohVi7Az5g2kR0nPQyHgdg1c6vxcWBaZnIT VjCfClEEgi8PQ== X-Nifty-SrcIP: [126.26.90.165] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek Subject: [PATCH 4/4] kbuild: include Makefile.compiler only when compiler is required Date: Sun, 28 Feb 2021 15:10:28 +0900 Message-Id: <20210228061028.239459-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210228061028.239459-1-masahiroy@kernel.org> References: <20210228061028.239459-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.) 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