From patchwork Fri Apr 13 05:06:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 133335 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp347760ljb; Thu, 12 Apr 2018 22:13:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+BOtSWneF3V36FgNIfx7vC/R+946AdjL7K7SnTEVs4mZXD7Uv5StnHxM+3pCs3abZ7jkxT X-Received: by 10.99.95.13 with SMTP id t13mr2984665pgb.145.1523596434280; Thu, 12 Apr 2018 22:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523596434; cv=none; d=google.com; s=arc-20160816; b=lGccPFzxMQMI25zbUjFnROvy0P5r3RAICxJ3REE8cxL7lAvkgzvZSfrIjWxNZoi/3q ITA1BUwhw2RkyBZtOkSJeHOBrO0YfzrJG+RyvBLVSUDowNOw2cAH2Ie61JzD8l15fFWc j1k313Trj1tJF95D/HK5MWFZ6QP2sOQpO5g0saX9ocephIYK7yDg8sFg2y9DBf2DbhHF Ltq/k1NNGgdApu/Eegl70yzljoV4Ro5eDC0NgqZ9V+94j+gRSnc2waTdZ/TQsut2lVVQ MfN29mBK58Cr9DpWAMG9LgpSO5MkROi1sd90zvNbHAW735PnG4JyVfEBCG1ztp+uF+Th QS8A== 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=ZNByCSmGPck73uN+2FHd9g+O3865D2r6m1y0qc7q6eU=; b=aIhm9rv6+J68ONaWvJ0Zi2bWR+Mw3v7MdxIxQ0jx/FCNG/jHEjONN+oxwQG0jsbGFP kKhSOnH2MmxwwfOlsBN2JayOpFIywIfPaVZRKOIptZBPbVvZ8P+frgrn5iZdYlQEfvai KPo38eAjcAr4a38FDac6yq/p9Rv2zWgN5DR1Gp2Dkft6aqY63vIEOvGhuLeD3icgfcDi x7K8iHVwZdEcCiWcAJjfHBOJ+Z+H11qWL1nPUi9JbkUcweecVnFwN1EDLkW4ykcE6uKF zTtqLZcwAMiu0Fk0pPira/lN3cTbeKpUEeUlbTzBOq20Jna0U5azRLiv6eZXxWBv+pHH KQNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=vLpQvsfs; 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 3-v6si4828759plv.323.2018.04.12.22.13.54; Thu, 12 Apr 2018 22:13:54 -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=vLpQvsfs; 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 S1753682AbeDMFNs (ORCPT + 29 others); Fri, 13 Apr 2018 01:13:48 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:54503 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041AbeDMFIQ (ORCPT ); Fri, 13 Apr 2018 01:08:16 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id w3D56lgD029209; Fri, 13 Apr 2018 14:07:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w3D56lgD029209 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1523596025; bh=ZNByCSmGPck73uN+2FHd9g+O3865D2r6m1y0qc7q6eU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vLpQvsfsq54XOiizbt1WszTE/bvobN4+z0YTo3kxYYvzl8VkOzgJb9kp77X0p3ng6 G0cPTFTyBbr0+DtrSqcAxkHD3uN2dY+f7OjpMLOqDYExhzerU9cayoZW8GMCEbSsUx XViYdckNuu6Vhfq4k0m5EJ7jUWILzLms0cKTqft7xQkOU0bD7c72iEc0hlMwdEpsVF bS5ZYNAx7dz3k7p9W7bYSjqL9cp3GGW8JKzhnWnlI8OgF+kLZmXkWwQIJTpP1mWJDZ 5sXMBheU8qnt9M3g/AOuKaVkfusi/0EMP1DDOHhrUmo2fVHgrGA9vSiR+h5myUvZYl nO/yO8J1ZGdWA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Linus Torvalds , Sam Ravnborg , Ulf Magnusson , Nicholas Piggin , Kees Cook , Emese Revfy , x86@kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 19/30] kconfig: show compiler version text in the top comment Date: Fri, 13 Apr 2018 14:06:28 +0900 Message-Id: <1523595999-27433-20-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523595999-27433-1-git-send-email-yamada.masahiro@socionext.com> References: <1523595999-27433-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 v3: None Changes in v2: None Kconfig | 2 ++ Makefile | 2 ++ 2 files changed, 4 insertions(+) -- 2.7.4 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 ca3e3e8..4b36329 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.