Received: by 10.223.176.5 with SMTP id f5csp2161909wra; Thu, 8 Feb 2018 09:22:22 -0800 (PST) X-Google-Smtp-Source: AH8x227tqetKUAmTBGNS6Gp5XIXtxtclE89m4xdyn6oN32R8CPj0IF/lKwyiImuw4J/WY+knNiBT X-Received: by 2002:a17:902:904b:: with SMTP id w11-v6mr1300549plz.41.1518110542772; Thu, 08 Feb 2018 09:22:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518110542; cv=none; d=google.com; s=arc-20160816; b=WauUPnmWw46JtwaDv3dAX5bPAP0R/cmlVdTwKkIodpGnzmrJ3YX7QGGLVCD2AmsZrq ehbQgfCcupbY+2AOaFZQpQPuczF//9lbkSH5N+7lRxaiyyHiyEEFYM5nE3gACTvAKSb8 Ia5C4SQWJj8tYTFGfwtZtrtHyVTUrtH4sWObU4c4xVbH2FT+RuBkBGGQ8/tkaN0kF9c2 c5Om78jjrv6R1TYholQRdNgIKGqbyLKsJ9UKLhUvk5OXKfsf97NeNClYLPuMRxEwcoi6 lEh++q1sYo52vk3Pg08rDw6b02gUmkZSwuMg4fv1G5221NQt/6hsJN1k87REkV/t8hFJ NqkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=Fb7jsewpEnhUH84xmfJ73rfosrfFCnOy8z5QoKeGvd0=; b=kG+YuGtOOqWpnA52xAfOl/IHSzHkXv5sUGinC5DdepSmqnq0sjDsKUNlCfUmtObJxG m0H+AOS9DQRdQBvDs6ZV22N78h8vW+3GZj34S3ofwxe1dkNtEoOpgFAHk3N0HsFXd2Km K0G4wVbiFXElVS/T48pFBGKzMdE3M7H9Jq1kou0fzohkaH28rZt4Bw0CzsrCrVQ3wQTx OJlq5m7B91iY+J6EV8L0is8zWdVQZ2FZvOcDuxGcDee9gPTqG2UQ+nfiF2EVLCFnSmGG byuvhHY87EteRFFN5egaMAE22Bm+F23lWSDgufDNBgwXHyVjwFowSLq6ItqUHgNvlX2O zLEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=kSpzILlu; 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 y20-v6si223984pll.773.2018.02.08.09.22.07; Thu, 08 Feb 2018 09:22:22 -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=kSpzILlu; 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 S1752470AbeBHRUr (ORCPT + 99 others); Thu, 8 Feb 2018 12:20:47 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:65248 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbeBHRUp (ORCPT ); Thu, 8 Feb 2018 12:20:45 -0500 Received: from mail-vk0-f50.google.com (mail-vk0-f50.google.com [209.85.213.50]) (authenticated) by conssluserg-03.nifty.com with ESMTP id w18HKZPW025997; Fri, 9 Feb 2018 02:20:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com w18HKZPW025997 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1518110436; bh=Fb7jsewpEnhUH84xmfJ73rfosrfFCnOy8z5QoKeGvd0=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=kSpzILluDLPgt6JFI5BJusFCRqclloSj7oMV4p6h4tSIQrJtMc/AWsuWCaXrj97Xe oKxt6ACejijGzhMFSYL+gcOfPL/CzsmP5IOhaoPH3oH5/xgJFSdCGg+D+fvP3cusD2 Gv1D5s6aEXsEy+4oJHvPQE+9n5w6B85NjEwnuNpfiVaP93LhP8OPxB2jH5j/pF/UCx psOJDCt7buTi9YyEeotkE3/BOB85NjYsmHhbP/y4Oo5063YgazqCWJEGSh4tpUhNaj +x0JY3CpL96Ke1ocXxF7cJaYspJs/HkwUyKWlslO3A5O0A2vud/7EENFNWiZfbuVg2 3/EtAMFQ5pVHQ== X-Nifty-SrcIP: [209.85.213.50] Received: by mail-vk0-f50.google.com with SMTP id t4so3193513vkb.9; Thu, 08 Feb 2018 09:20:36 -0800 (PST) X-Gm-Message-State: APf1xPCs0INzWzVjxOsWKHPscRtPLdjiVErV7IYX5Q5E2HIGZi4dbkbZ 0jdiFYNJWO9kYpmt6DVlwXMsks7kRVViUbWhVsY= X-Received: by 10.31.92.142 with SMTP id q136mr1103817vkb.29.1518110435200; Thu, 08 Feb 2018 09:20:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.83.212 with HTTP; Thu, 8 Feb 2018 09:19:54 -0800 (PST) In-Reply-To: <1518106752-29228-6-git-send-email-yamada.masahiro@socionext.com> References: <1518106752-29228-1-git-send-email-yamada.masahiro@socionext.com> <1518106752-29228-6-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Fri, 9 Feb 2018 02:19:54 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 5/7] kconfig: invoke silentoldconfig when compiler is updated To: Linux Kbuild mailing list , 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 , Jiri Kosina , Masahiro Yamada , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-02-09 1:19 GMT+09:00 Masahiro Yamada : > 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 Currently, the updated compiler is detected only when building the kernel. External modules should be built by the same compiler as used for building the kernel. If a different compiler is used, different options will be specified by CONFIG_CC_HAS_... options from the .config Should this be checked? Or, is it just "Don't do it" thing? If desired, CONFIG_CC_VERSION_TEXT is cached in .config then it will be possible to compare it with $(shell $(CC) --version) when building external modules. > > Makefile | 2 ++ > init/Kconfig | 9 +++++++++ > 2 files changed, 11 insertions(+) > > 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 > -- > 2.7.4 > -- Best Regards Masahiro Yamada