Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2140843imm; Mon, 28 May 2018 02:26:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK11kgVMlFiz+wvY3kdyyk+eVpsIoTiPXiuYh4URUDvuGicFimYTzFEGpppHZDHojcG4z9R X-Received: by 2002:a62:9d82:: with SMTP id a2-v6mr3860609pfk.223.1527499583898; Mon, 28 May 2018 02:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499583; cv=none; d=google.com; s=arc-20160816; b=hbMAG6D3hAfJsjbdUzukf2JMKURP/U+mNClELHOQEPaat/dD4VZVom0mAP67ROgT0c A6niGGW+mapyMfsQgZM2/iPCyOsM0cOxS2W13d0Xdd06PbiWvftPR2FQPorW5iaMsrZW PDggQNq72UHeU9nY0F0n5iUTU7887iB8OWqZGPS1OPMw1xwnH/inzX/xG1mIbPku4+O8 H9iBvzzID/D0ifu6JdowDeJtHgkN01gvXv3NJAo/aAMUJ6E3zPUgJMsvJbGJGHQdwzbr H4NbaITVoiEOD9sLj08iPCMhfOZNGutrnuMFeZXl78t0fKkShdCawWmm7CGvNFc6g+Vc S1Zw== 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=AxljiM6nQMv29U6TbNmPPbMehnAnc+k5ZzXGvso5DlI=; b=igqRsyiXDFK1OT49WDorSfU+nyxs5ZMXvipeHNPSsvru1XglLaeVDpxuH+5u2dHluY c/EfTxvvprpQMCO6Y0ENOrFZOh9onYG1XiYQkc12xtEc3AygvFD4K0pRdrKI4C96kCiX NevmFzDm7hbo7szlkF2/c/+81n8G9c4EkAL0xXcu1xoitkueiap+aJB+tAVdJXQXckIx Z3Lm7dqSc1Q9u+LbOdxpzLssqiJAtw5uidpgyt98nxOSZDqVzemANqIGIbMVzht8YfkC RlZXfsXci/hD78pPk7WnRDQLazF7+m0/cfczNAJUxpaN8PsfS3mXvWJzQxqjDUHRZ0+Z Wq8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=u+XQu24L; 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 f71-v6si23256323pgc.641.2018.05.28.02.26.09; Mon, 28 May 2018 02:26:23 -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=u+XQu24L; 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 S933351AbeE1JYm (ORCPT + 99 others); Mon, 28 May 2018 05:24:42 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:22283 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933233AbeE1JYj (ORCPT ); Mon, 28 May 2018 05:24:39 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-10.nifty.com with ESMTP id w4S9MInc027506; Mon, 28 May 2018 18:22:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4S9MInc027506 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527499356; bh=AxljiM6nQMv29U6TbNmPPbMehnAnc+k5ZzXGvso5DlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u+XQu24LfQSENN5ArAfPLIgPV16g+n+w7uSQpEnuCImQYXRH/IgqCrqz+FvKa2NVA ZVsiLL0f7F6sJP8SEvr47CCplaCpYYG/3L7Ku4vde8MrxAjb06wJfW9UyaVBa+XDMz 6FHnJPqFpW67N9R9Qrm+LTl9d2XrgNRwDuuimluYtqp5HnpqiC/LPTb+788K9/DJzA J5G4oxJOqyE/1KAgbWkGvSLAs/bwltVQd0EEGU5CRh4sDYtgg8W02KKPKr+wOBZnuf c84rCnXhwBCg4S7h3jFJuNor3CaL1DzP8KOH83+4Kr05uCOtJCL8YYHHuaH97benL4 eogyEE5zOKP8Q== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kees Cook , Nicholas Piggin , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Linus Torvalds , Masahiro Yamada Subject: [PATCH v5 21/31] kconfig: show compiler version text in the top comment Date: Mon, 28 May 2018 18:21:58 +0900 Message-Id: <1527499328-13213-22-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> References: <1527499328-13213-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 the 'comment' statement. 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 Reviewed-by: Kees Cook --- Changes in v5: None Changes in v4: - Add comment to arch/x86/um/Kconfig as well Changes in v3: None Changes in v2: None Kconfig | 2 ++ Makefile | 2 ++ arch/x86/um/Kconfig | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Kconfig b/Kconfig index 4af1b42..5b55d87 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 58afa07..defb383 100644 --- a/Makefile +++ b/Makefile @@ -442,6 +442,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/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index 6a15c4d..a992f8e 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig @@ -1,6 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 mainmenu "User Mode Linux/$(SUBARCH) $(KERNELVERSION) Kernel Configuration" +comment "Compiler: $(CC_VERSION_TEXT)" + source "arch/um/Kconfig.common" menu "UML-specific options" -- 2.7.4