Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2467898pxj; Mon, 10 May 2021 03:49:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytJF4HUIdwu4W3Y45oqH/uBKpwS37C11WIbZnK8qCEbowwomnwm+ta4k0cXNlAHDipwZG7 X-Received: by 2002:a05:6638:3bc:: with SMTP id z28mr20651391jap.133.1620643792691; Mon, 10 May 2021 03:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620643792; cv=none; d=google.com; s=arc-20160816; b=MWN+gHwObuX3aGK9HRDU+XnOLejTdni4ZoNrCV3hJ/j3ZpX3lmnY+sHYnfcGkhxJfE evaQ6PfbJIVIJ8wgJhGtK5WVL1rWUrHslrwA8CZdVQ6s/x/rUHexeIfI6F+GiDibYAwu qFaeYMVJyNRVaPySA7Fx+a1bZeOmqyCaJnYkAXzEOH4h7oDW4332P8ALfaM3s4bAJ9fi 1pbuV+nmXLSqMMM2E1uiRT4S47hxvULS1dvwW5E2lSoLQ3OdB+iUe1Bp7ivYZl2SDzST VljWnE4KIbbHnjUfE7Pmvc9r3+94YA6lCmVngJKvAV0VmjG4gHgNBM6TqsbRiv2OBDuR WgeA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w0o2t/AkZ9dI9llQy3yd65pulocOAAS6gjo/x2cghj8=; b=OVQiMk9BBzdAcB/1whWD5wAPS5cgqHlcu0oBShzSQF+EEL9wgLCJEwDN6Fg/+nXQPp 0/HIL6pDXGkm+qpSxEzAO2hdFGHYEosdxwqoPO1XwZithxguUHtN6WgwPN2Zx+3AGrml Gr9P0xRW/01tctdqjEJ6zE7YNdz6Eln8fi5cgcrYxC3zpdWJkmAIOROPAOcpeDwn/zD9 IosIKLuf4tq/E0PzFjzkYovfTX0Pp5gNecAuaIbKSUO0GLZkCUAo114N4bMFh5+c8ZwH ap7w2rWV6JB6Ugi4thqD5RoFlqUdAGMgi8TEJFnU+dScM0lmnjnNlPN/gSiwOBy9561q CduA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C0fO+RwU; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si9304248ioh.5.2021.05.10.03.49.40; Mon, 10 May 2021 03:49:52 -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=@linuxfoundation.org header.s=korg header.b=C0fO+RwU; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231795AbhEJKs4 (ORCPT + 99 others); Mon, 10 May 2021 06:48:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:49878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232788AbhEJKke (ORCPT ); Mon, 10 May 2021 06:40:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8A07961962; Mon, 10 May 2021 10:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642663; bh=SVOuE3lKZ+7W5j0ZS6Z5RC2vmw3qtcOexv18YUv8hhg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C0fO+RwUHD4B/gMwljJH8phC52v078wHmPF0Ibb8eu1tiVDLZILCL6hS2ek3FHnou IRwKAHjE/WhK+txsB3QMIfqkC4G6uUnwjhc/lLbsMXFbiHMtQfKmrMyXbLjSiokX8G ip7BloZnvUWtt0pUT3FBVNrmeYKVuX8wzjT7YLpI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Elliot Berman , Masahiro Yamada Subject: [PATCH 5.4 162/184] kbuild: update config_data.gz only when the content of .config is changed Date: Mon, 10 May 2021 12:20:56 +0200 Message-Id: <20210510101955.422273898@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510101950.200777181@linuxfoundation.org> References: <20210510101950.200777181@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada commit 46b41d5dd8019b264717978c39c43313a524d033 upstream. 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 not changed at all. 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 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 Signed-off-by: Greg Kroah-Hartman --- kernel/.gitignore | 1 + kernel/Makefile | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) --- a/kernel/.gitignore +++ b/kernel/.gitignore @@ -1,4 +1,5 @@ # +/config_data # Generated files # kheaders.md5 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -122,10 +122,15 @@ KCOV_INSTRUMENT_stackleak.o := n $(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