Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2639258pxy; Sat, 24 Apr 2021 23:26:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsuxrMdRX6bTEjq1fm6Fve9g0dQ1OLSClgdA/5eOpumO0168LovwA8S8LR6HGlrbXWkwX1 X-Received: by 2002:aa7:c049:: with SMTP id k9mr13826288edo.56.1619331967141; Sat, 24 Apr 2021 23:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619331967; cv=none; d=google.com; s=arc-20160816; b=rtQDLzDTkZkNlD+PoDDbuxVXGOytKzeZ/Mfi1PVPZonLlxcOQcZcasb+ur1lZZ8V6k nRHhTWTXAnmAzm9MfwI3+yK3H5pdFUELcj7q+DDzg+ETDTPFp3qfs2cft/pBr+gaFz0y v1Ny4/BdMmPpu+mA7Jq+8puieZ/6fePUk2HXtWXf0ex+FasaVbPme0z/hzie/IptVe4x ZF5zRTZJAmwmCZfL66AX9mTt7xlWKQ+bzX0/ytqa5+ihQVYSCbxcOzWs8t5BRXo1iT87 c+CXZ+xoYO7bmDuRLoM4yAsjPnS13z4RHz06xjJSC1NivDsAbbDA7AfdWb6snYS9xUtZ my6Q== 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=/O20R/iU0g1jzgc/IGeu4SUnv5vDMesuCm/+pl5398s=; b=OCWKIT8LmTuD2PRsvFPplmQH+obvPtPlLJ7gk0uRHKOQNt1RpK1TzY5KaGJci+3Uw+ RRNaxfWNpHm7mzph03DiA8728lGTjuY3ok9RQ/BVftTaq/7EyRKXz5PG7yTcVHtiCOdQ Eq+0GUMXpJ+nbaBgQDlg24DXfRTeZSOhTvFu+c69y4GidwOC5ZfhERTCTwppfl5cQxvx SctmFUXPY+scxob5Y/1PN521JAF3eKUmoDPuwrlqXgpFm5vMMqaKF6CLWTtJTkygvZXH X1GZ4B6b40WXaLQkYAOTH65LmLjUrQegs50mz/eZRqu3JBW93eI7s6aq1YitJLuTj/Wy jbyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Pqdyjgfw; 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 ne6si10162100ejc.159.2021.04.24.23.25.43; Sat, 24 Apr 2021 23:26:07 -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=@nifty.com header.s=dec2015msa header.b=Pqdyjgfw; 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 S229837AbhDYGZ1 (ORCPT + 99 others); Sun, 25 Apr 2021 02:25:27 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:20919 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbhDYGZY (ORCPT ); Sun, 25 Apr 2021 02:25:24 -0400 Received: from localhost.localdomain (133-32-232-101.west.xps.vectant.ne.jp [133.32.232.101]) (authenticated) by conuserg-11.nifty.com with ESMTP id 13P6OBfM031298; Sun, 25 Apr 2021 15:24:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com 13P6OBfM031298 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1619331855; bh=/O20R/iU0g1jzgc/IGeu4SUnv5vDMesuCm/+pl5398s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PqdyjgfwOE+3wVi8ZeKywMjOJuF+GbtdqRp4Y1BTtKCRAu4+VIlrwdIsDunlazsdX 8NfTbS9c4VnQbMX9tQcYohoK349WWrv3ADlpIabl6PPiX8YTtYCpQC84Lx3LpxrYdl 7TsyrWT57P3uY7xqmVJhM2NlMMvaIAU09xr5KVcN9HNJZbeLSQIoml/bkYlszhXz2j vo0Q0jKcK5WJXqZFr4B8dbetTVebCFNdmXMhDZeoZztquietvm56Wn/1OAJ+2ejGvN MOVNpBQb7McirjkrdwMr9mEfnlKkNEjU4HjAGT3vYPOXQbWRdWtF8/Yg4hSgaUOjhs M18Qsyzz3W+Lw== X-Nifty-SrcIP: [133.32.232.101] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Elliot Berman , linux-kernel@vger.kernel.org Subject: [PATCH 5/5] kbuild: update config_data.gz only when the content of .config is changed Date: Sun, 25 Apr 2021 15:24:07 +0900 Message-Id: <20210425062407.1183801-5-masahiroy@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210425062407.1183801-1-masahiroy@kernel.org> References: <20210425062407.1183801-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the timestamp of the .config file is updated, config_data.gz is regenerated, then vmlinux is re-linked. This occurs even if the content of the .config has actually not changed. This issue was mitigated by commit 67424f61f813 ("kconfig: do not write .config if the content is the same"); Kconfig does not update the .config when it ends up with the identical configuration. The issue is remaining when the .config is created by *_defconfig with some config fragment(s) applied on top. This is typical for powerpc and mips, where several *_defconfig targets are constructed by (ab)using merge_config.sh. One workaround is to have the copy of the .config. The filechk rule updates the copy, kernel/config_data, by checking the content instead of the timestamp. With this commit, the second run with the same configuration avoids the needless rebuilds. $ make ARCH=mips defconfig all [ snip ] $ make ARCH=mips defconfig all *** Default configuration is based on target '32r2el_defconfig' Using ./arch/mips/configs/generic_defconfig as base Merging arch/mips/configs/generic/32r2.config Merging arch/mips/configs/generic/el.config Merging ./arch/mips/configs/generic/board-boston.config Merging ./arch/mips/configs/generic/board-ni169445.config Merging ./arch/mips/configs/generic/board-ocelot.config Merging ./arch/mips/configs/generic/board-ranchu.config Merging ./arch/mips/configs/generic/board-sead-3.config Merging ./arch/mips/configs/generic/board-xilfpga.config # # configuration written to .config # SYNC include/config/auto.conf CALL scripts/checksyscalls.sh CALL scripts/atomic/check-atomics.sh CHK include/generated/compile.h CHK include/generated/autoksyms.h Reported-by: Elliot Berman Signed-off-by: Masahiro Yamada --- kernel/.gitignore | 1 + kernel/Makefile | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/.gitignore b/kernel/.gitignore index 4dc1ffe9770b..c6b299a6b786 100644 --- a/kernel/.gitignore +++ b/kernel/.gitignore @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only +/config_data /kheaders.md5 diff --git a/kernel/Makefile b/kernel/Makefile index 320f1f3941b7..605ec3e70cb7 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -138,10 +138,15 @@ obj-$(CONFIG_SCF_TORTURE_TEST) += scftorture.o $(obj)/configs.o: $(obj)/config_data.gz -targets += config_data.gz -$(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE +targets += config_data config_data.gz +$(obj)/config_data.gz: $(obj)/config_data FORCE $(call if_changed,gzip) +filechk_cat = cat $< + +$(obj)/config_data: $(KCONFIG_CONFIG) FORCE + $(call filechk,cat) + $(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz -- 2.27.0