Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2904881imm; Wed, 16 May 2018 23:23:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrr6Nz9oHCxkhBRHzIuQJwIyoX0csfjaOF10KhjdQu1f1t00ZUPwEuFHjT5lA+5ezOIYcCo X-Received: by 2002:a63:7d43:: with SMTP id m3-v6mr3177448pgn.117.1526538190978; Wed, 16 May 2018 23:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526538190; cv=none; d=google.com; s=arc-20160816; b=DR6NlpNuCCVIVbqaZxj9m0Anw0JcgwKCuiPnhrOhH8Y8o7aB/XoZgwZEmn9A9Vj5M1 DiedofcuA2k7xM1jKkNPo25k8lfUV2joRJTQF2rXUmvxnFuznLBL0RI6GK/JpP0Wahdu ++e1QdAj6nQqbnV5kMp3UQNe/ypPecm9r+gErIFqgbItTUeNKuCMWEE7flsB+y4GW3n4 u9CzMFq7dqvS0wv3Aihtja0dlBic8EMG4koKHHgfNNFsr9Rlhjka/OW+2ttfi3HnUl4A nvuNPI47LMKaC+NUxMqlg78CGcK/M9dqKlYUuAaupcDvKJrXcGSs8dHjpwoLLoV8jDSX nxuw== 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=wtmluTE6253pNxx3As88qgTQx0hPxMcrVOSGHz81Wv0=; b=Io/d3As5rqXFSaHvHHTvQ5FktCr/ecFjh67KBFCh5QYCxz+b5K9kA1xVZui+nCFcRr wk3xZEgPC8nk4GedHpbIY0UPu8eLIvkfkvalxOS8TaOZnuWUiOz+d97m6MsL8hDRkPnN 2H+fwShOT8sxxmnmca4WvEfe3dQxbVgg5jGJrjbCoNCxSDZS5FFLsgxAPDRrUNHa40m9 vfn4JXzfX71P7npIyzYRPp+Q+QPSjgfpFw0pA2KDp8JPJzY3ay5bTblb13kCcXlxaTKg +0IFloySs5TtgJEz3EAvD33Rh356ZWgYDTgzXWCI69gHCmyI0Trq6NBAmgG1Tu+qa91+ UVaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oSCsRszv; 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 ay8-v6si4448796plb.244.2018.05.16.23.22.57; Wed, 16 May 2018 23:23:10 -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=oSCsRszv; 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 S1752539AbeEQGWL (ORCPT + 99 others); Thu, 17 May 2018 02:22:11 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:25143 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752175AbeEQGTU (ORCPT ); Thu, 17 May 2018 02:19:20 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id w4H6HbUJ002841; Thu, 17 May 2018 15:17:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4H6HbUJ002841 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526537879; bh=wtmluTE6253pNxx3As88qgTQx0hPxMcrVOSGHz81Wv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oSCsRszvYz++jwG0bqqQUsJ8pDndpa0B305XNY5jnE9RMc1cS0RV+GEtM2GNtXyoA nMWJabZfTiUsaYLeIHmNebTUrlbhJurY/JN+yBh95wZ8QlfFjkobzf1GvmkQ0N9qTi bgBOnnPTZJhmUByy96/6zZcT9ddi6vk46h4KadyE4JDz3rEi7KzB7fWcuCn3HAeGSm uUzzkrCbmbQS8qa6RJy0JlM2JfUBz9u7K6nbBcBatvX+qUofgQAijN//lg2M1LOTlg MS67EuIUqgSTVoLSrVRK+VK4ciYMTtLd54aOqP5Er/8ysmcLsN/pTMqH7E5dZEp2AS wO0Xd1Cwd0HZg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Linus Torvalds , Sam Ravnborg , Ulf Magnusson , "Luis R . Rodriguez" , linux-kernel@vger.kernel.org, Nicholas Piggin , Kees Cook , Emese Revfy , x86@kernel.org, Masahiro Yamada Subject: [PATCH v4 21/31] kconfig: show compiler version text in the top comment Date: Thu, 17 May 2018 15:17:00 +0900 Message-Id: <1526537830-22606-22-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526537830-22606-1-git-send-email-yamada.masahiro@socionext.com> References: <1526537830-22606-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 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 01b2211..7529825 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