From patchwork Thu Feb 8 16:19:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 127679 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1641786ljc; Thu, 8 Feb 2018 08:22:32 -0800 (PST) X-Google-Smtp-Source: AH8x227g6t15ZxZOwKVvqVKp8FzRpZC11psS3QKDpTvOcz62ZqYkHdRHmv1QkxSbr9ryyVJEv3jI X-Received: by 10.98.135.204 with SMTP id i195mr1223609pfe.41.1518106952726; Thu, 08 Feb 2018 08:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518106952; cv=none; d=google.com; s=arc-20160816; b=E6SE6v5ofwvRHblD7LImoVT87Pcj3f+oW69LsC63Csw3NGI8FbwAuy7yXyI9Vtm2qN 2/jW1yaKQK2KCW51xO03VVTwvvco/bjYmTN+bSJVmk+hxmIs4SOlhe7BhPsLekYCs5xH DyKv4mlMTYDZBK8Ud33Quv03lA0BMB0clKnYvXvowESe/XEYxXdk2IOV5KEZk/sDKslk nG5zg/dCeN6C+4UyAA/T9gEeRSbdwsYRavLzFHhylp2aTEwuC6M9G38acIb+VCplzgO/ d1yHrnq3++rc5wTtZ1Aosvl86wXeBL4RVOx0qVeqynVTbZKk4t0Hnr+IKOFnpdigyu1m gUbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=/g1y1Iw1M86dfdHAksqnjpCIIERRxDGzTanKycUqsIw=; b=w5YQRvsz7fFyftpqbFsq4DXuO9HjKsV4t7YidWctrjCoU36vQVvJ7//pmV/+HW2tpH m36K9TbS7hn3yPBKHFYffIGBuliXz/5oOM3vrIUUVDubEuMqcT+56EAvmi5i2VqUb8dh MqRtYiUusuucpypGVm9QH3IhBxkTPXtZJDJpxGHAwvr2Df6/3FF7rj8LiH0i/Khv5tSo iqwSAIUvIfe1OmeZ/LnKJP1Gn+mYpYeBj6O5M3ir8ZJIcRIcC+4B5pLtFSHo6nqEKwzi DEr9nwBzIcCo9eLyeF2n1cLma5QRZzMNd1cd+cBZsItHFR5XE+lff6kClC+9pROc9qpu y72Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=zcIAyvom; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si133503pgr.631.2018.02.08.08.22.32; Thu, 08 Feb 2018 08:22:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=zcIAyvom; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752617AbeBHQWa (ORCPT + 13 others); Thu, 8 Feb 2018 11:22:30 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:19360 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752275AbeBHQVh (ORCPT ); Thu, 8 Feb 2018 11:21:37 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-12.nifty.com with ESMTP id w18GJP1H021191; Fri, 9 Feb 2018 01:19:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w18GJP1H021191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1518106772; bh=/g1y1Iw1M86dfdHAksqnjpCIIERRxDGzTanKycUqsIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zcIAyvompiaZrVI+RLGR8xnP0qT0sVA7c45lqr9Ibmu/tkVnbTKI7KKbDA0ui6dPN kbgVaswX4DIBXO92awYknr1hpyhsE2vUPTHtErygXdVGBmdR+WtNKI2lTANcNPDaR8 eh3CfcJ6GnwLRXTHKytO11YWZcF4DniLehLX1d3etSrcqhfaAo8vkZCl/22TfFkEDE pBH8K+vhOtNnxuISENoGaXLhJFpK1ukaNB0/N/XtWMU+EFwYhA0CflKehi8HaRwMbP 0+4UA8gXD9rP0mPArGtjF6JnfWWmHhtZ1XwV6R0PYeFXt1o9iI7guudKAb3sz66F1q A+3J9LbtEV6JA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org, Linus Torvalds Cc: Greg Kroah-Hartman , Andrew Morton , Kees Cook , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Michal Marek , Martin Schwidefsky , Pavel Machek , linux-s390@vger.kernel.org, Jiri Kosina , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [RFC PATCH 5/7] kconfig: invoke silentoldconfig when compiler is updated Date: Fri, 9 Feb 2018 01:19:10 +0900 Message-Id: <1518106752-29228-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518106752-29228-1-git-send-email-yamada.masahiro@socionext.com> References: <1518106752-29228-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Moving compiler option tests to Kconfig means you need to re-run Kconfig when you update your compiler. All CC_HAS_... symbols and other symbols that depend on them must be re-calculated. It will be nice to detect the compiler update and automatically invoke silentoldconfig. This can be done by adding one environment. With this, silentoldconfig will add something like follows into include/config/auto.conf.cmd: ifneq "$(CC_VERSION_TEXT)" "gcc (Ubuntu 5.4.0-6ubuntu1~16.04.6) 5.4.0 20160609" include/config/auto.conf: FORCE endif CC_VERSION_TEXT contains the first line of "$(CC) --version". If this text is changed, silentoldconfig will be invoked. Signed-off-by: Masahiro Yamada --- Makefile | 2 ++ init/Kconfig | 9 +++++++++ 2 files changed, 11 insertions(+) -- 2.7.4 diff --git a/Makefile b/Makefile index 2ee49c9..9afd617 100644 --- a/Makefile +++ b/Makefile @@ -441,6 +441,8 @@ export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL export KBUILD_ARFLAGS +export CC_VERSION_TEXT := $(shell $(CC) --version | head -n 1) + # When compiling out-of-tree modules, put MODVERDIR in the module # tree rather than in the kernel tree. The kernel tree might # even be read-only. diff --git a/init/Kconfig b/init/Kconfig index e37f4b2..64f9dd2 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -16,6 +16,15 @@ config DEFCONFIG_LIST default "$ARCH_DEFCONFIG" default "arch/$ARCH/defconfig" +# CC_VERSION_TEXT is needed here to invoke Kconfig when compiler is updated +config CC_VERSION_TEXT + string + option env="CC_VERSION_TEXT" + help + This is used to detect if the compiler is changed. If the version + text does not match, silentoldconfig will be invoked because we need + to re-compute compiler capabilities and symbols that depends on them. + config CONSTRUCTORS bool depends on !UML