From patchwork Tue Mar 27 05:29:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 132449 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4655223ljb; Mon, 26 Mar 2018 22:34:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/KhT4g1YxEupzT69MYE8CrGZC9eFICx30TygVcgfULwRdiPQy4cT/wPmvZ71LVLfeFrA3i X-Received: by 10.101.100.24 with SMTP id a24mr4947755pgv.7.1522128890729; Mon, 26 Mar 2018 22:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522128890; cv=none; d=google.com; s=arc-20160816; b=I3K6fBP62igMOl3iovgYPU5p3ogDQSS61AEh7kxsbrrezRbORQbty7BNaKyWWCps4b 89l4BodseS0dPqWzniqZ2+GGzTZaK0jXT2N8y3a37zoSDK55hqj3XJIKGnvqecDnNwWF zhBBPaaSiibhZ58LEg0ab7Z8cH1Ih5CMaDjztMnQC1v97MAGQsEazdHl/3qa0Lvhf+ID 4b3Nk+L+ql0GPwRIumIlQMNQ7Ts4xtT9RtBlk57fj+Lw3yJ+NqUDH+mTy8+CAgjt3Ha/ Q6FJ4oza+yHf+4LLYRUGA9oEEU8+0ayrFkINCvXPHboCMNmYadJgiatiHj8nz9RlCsF+ 9VCQ== 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=Y0EgiF5xffNcee7N9S9KbbQwPIhX8Hv7iF7h8moPLZY=; b=lt6Y9nirS35eBSonZQKCABM7HmZsuIcrskkpSK3UxVb4J7csfEvItBhobEz7r2jWf5 jsM7BU+M3KshEkYVt8aVkql5v0yPJ71lEsyRSPHsSNsYq8Yd8YVQvMNfwsLbDml72vLH RAX9PgZqyW03tDvhR+L7YjMQMmzLdBJU2nx4lzE/txkQ5XgZo0sQUGBj6Vk4KMHqTiVJ b6TwcBj5SlKtTrCdKRYzlRMUteVP1f3wFfxkNjwEzymJYF3gFKqdNCmmrtyeJuAMBbLE OVx73f7YYXNvF1VBf08EyFXDwqiL+Je3ioaZABKgjcj0fi/YzJ8Bca5OKQByr9DtlRUx vJBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BUh/7azb; 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 m11-v6si512677pla.724.2018.03.26.22.34.50; Mon, 26 Mar 2018 22:34:50 -0700 (PDT) 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=BUh/7azb; 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 S1752096AbeC0FcE (ORCPT + 28 others); Tue, 27 Mar 2018 01:32:04 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:44599 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbeC0FcA (ORCPT ); Tue, 27 Mar 2018 01:32:00 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id w2R5TaLv011947; Tue, 27 Mar 2018 14:29:52 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w2R5TaLv011947 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1522128593; bh=Y0EgiF5xffNcee7N9S9KbbQwPIhX8Hv7iF7h8moPLZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BUh/7azbvSXym3RK9hyEVvCdE8sCN/fMp3SmWIjgXDsb5NIaOhhLaPlLXHk30mASd HrUJC6qR2uKJyco45ptBmMMBtn0poki2kuG/CzFsdjWU/9Jj7TYwCpet8xwhgHYkTC 58ITtQLOUf5bnY1gYsWXZVKpTADUH90vsNkVj7eI5DuVCWGRwNwQrb2bskJqTeqOga hneYruvR+smdoMDkEu47q9nsR6XrjsGLMKPKpJDJNAW0sG0ltlRRvpBKwrVzLZKN2+ QHr3fUJP/tT9HfUE5ujCCEbbRhHm2yiEFxQ4ND9VBrOwkHN/loelKedysKT1cra32R 2kecjWp3G2UMw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Linus Torvalds , Arnd Bergmann , Ulf Magnusson , Kees Cook , Thomas Gleixner , Greg Kroah-Hartman , Randy Dunlap , "Luis R . Rodriguez" , Nicolas Pitre , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 12/21] kconfig: show compiler version text in the top comment Date: Tue, 27 Mar 2018 14:29:26 +0900 Message-Id: <1522128575-5326-13-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522128575-5326-1-git-send-email-yamada.masahiro@socionext.com> References: <1522128575-5326-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 The kernel configuration phase is now tightly coupled with the compiler in use. It will be nice to show the compiler information in Kconfig. The compiler information will be displayed like this: $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- config scripts/kconfig/conf --oldaskconfig Kconfig * * Linux/arm64 4.16.0-rc1 Kernel Configuration * * * Compiler: aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11) 7.2.1 20171011 * * * General setup * Compile also drivers which will not load (COMPILE_TEST) [N/y/?] If you use GUI methods such as menuconfig, it will be displayed in the top menu. This is simply implemented by using 'comment'. So, it will be saved into the .config file as well. This commit has a very important meaning. If the compiler is upgraded, Kconfig must be re-run since different compilers have different sets of supported options. All referenced environments are written to include/config/auto.conf.cmd so that any environment change triggers syncconfig, and prompt the user to input new values if needed. With this commit, something like follows will be added to include/config/auto.conf.cmd ifneq "$(CC_VERSION_TEXT)" "aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11) 7.2.1 20171011" include/config/auto.conf: FORCE endif Signed-off-by: Masahiro Yamada --- Changes in v2: None Kconfig | 2 ++ Makefile | 2 ++ 2 files changed, 4 insertions(+) -- 2.7.4 Reviewed-by: Kees Cook diff --git a/Kconfig b/Kconfig index e6ece5b..99ed4b8 100644 --- a/Kconfig +++ b/Kconfig @@ -5,4 +5,6 @@ # mainmenu "Linux/$ARCH $KERNELVERSION Kernel Configuration" +comment "Compiler: $CC_VERSION_TEXT" + source "arch/$SRCARCH/Kconfig" diff --git a/Makefile b/Makefile index 5cadffa..3dc9eb8 100644 --- a/Makefile +++ b/Makefile @@ -450,6 +450,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.