Received: by 10.213.65.68 with SMTP id h4csp15293imn; Tue, 27 Mar 2018 20:27:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx481bujvJJMEeyrf9x9Ng+g5kTMxNFSfX1migNC+aTpcm47fUbBRitqFUHcC8ebSTOAns8GX X-Received: by 10.98.107.138 with SMTP id g132mr1510670pfc.163.1522207672286; Tue, 27 Mar 2018 20:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522207672; cv=none; d=google.com; s=arc-20160816; b=Mi3RnmXfHewB69S0iGZqv1rf8Z4HR1zjD1h7fN6BgSYtMzwij3YKvP1sdbn+kLyyws h7O7mmOTwL92fSecz/ao52UTxtxB7Kq0rPp1CRBBK7FMImMiJDmg0R6jBrbSnkFFhkKY z3WbtsYZyg1WUANdDQ5nGRvUuQsuUbx/6iynljnuclQJ5gQSlCQNLBe9F4/n1ebXPrz2 ljj7CMDDXiOt1ZB/P27R6UDQrS9KFe/bLCnbAId3eBwJ4Xh+WHDlChFv9aUJGL8Hed11 fUtHAnA/J5SuYtYuoSBZL/XCXUCPnNg+NACTQ2czhj/kxg6ekunIVYoavDZ8015V1xBY osaQ== 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-signature :arc-authentication-results; bh=UMVv6GxFs/bxqjQb9cNcWMjQpkflX8Ywh2T7fUcm+6Y=; b=VDYNyDId/Inl21Xy02+ngi+NsgUGwjsNJG6Yu6WfObwxH7C/FhQMe62Pf2YScVUCx9 2oHFvNE/bgLONfTT5qyGPMalDMm786bLAwVj+P6sikFSSs7GnQSfyxqWzn4EqJqXT90H nZhHLxRNnjYMV+jLKdxECgxhhWr54qeT4x6x/L2ZFf586oNUI0eOdTKUaDRNxsEav2c3 zw0TVC4aiJ9uFcQ4mez2rFhAVupKJPHlShJsTS9t1A2oCLi8uuTndqcLUGYK+Ldzj3bi gIN5XDciMU6QHfXFew+vdKd9YOgTrHnibBw/uX36NqTuln37zmPUKn0XtDlMDl18u9L/ WDGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=A7/QXX+A; dkim=fail header.i=@chromium.org header.s=google header.b=VxMq+yNN; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1-v6si2523732plo.250.2018.03.27.20.27.38; Tue, 27 Mar 2018 20:27:52 -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=fail header.i=@google.com header.s=20161025 header.b=A7/QXX+A; dkim=fail header.i=@chromium.org header.s=google header.b=VxMq+yNN; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752555AbeC1D01 (ORCPT + 99 others); Tue, 27 Mar 2018 23:26:27 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:41595 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbeC1D0M (ORCPT ); Tue, 27 Mar 2018 23:26:12 -0400 Received: by mail-ua0-f193.google.com with SMTP id i2so655047uak.8 for ; Tue, 27 Mar 2018 20:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=UMVv6GxFs/bxqjQb9cNcWMjQpkflX8Ywh2T7fUcm+6Y=; b=A7/QXX+AocFalzoqYQqQGmVdQAttg1YWVhm8CkiqnDm/rIvYep3Ut3hi8ffRl9KmjM l46/VQGmFUB3j1acYbZE+mYJVbF2jRF+d2HTMpskXn8QD8Y3gZLLRoZ/M1bLuyhn9B/O XCCzndd5uD7Am7J+tgL9saDRuL7LBY2aE7nlNYgOv2YoNnI2uI516+gGjgrcLjPEpt+W BY/KECZAL/aeI7hffrOO4fzmizcNMqnNGS4tCSizIZAQ92ZCwimFte3FTPXjzO9aOcY1 jgcC17gG2M8h14Nv6/IOOHBV7QKo5/n7iij61EXh2EnrKsrM/LgYF4AREsT9GhMXuQF2 sBMg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=UMVv6GxFs/bxqjQb9cNcWMjQpkflX8Ywh2T7fUcm+6Y=; b=VxMq+yNNyD2nbfUy9ZTJsY9MjXqMTVC5GGNipWEF1mPM6z0nzQ64MCbIZYRBd0hB6D NURqJ0+6KODepRdDtavaD3/2UI5LZB7gyt2WDXuFymzhg9mx1AWnfZHhGOgyX2ijegRj jqLmm/k5pAfNPak5M8J+JeBciN0yrF38q67k8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=UMVv6GxFs/bxqjQb9cNcWMjQpkflX8Ywh2T7fUcm+6Y=; b=P1MRL8HNL67Oz/OEgJMqKIDkEUkfUZJ2S4pb7Cw7P0GKM9yHWcNS1G0SCmG7VNi6yD M1uYY0oRSZplCso5M2mhZwT8Y1MRcM8r4lFB9h63H4Tq882RwlXe06ltyM7Ve7CLc00q Rw+iccNyZ18A4gQkKiV04CTPMfXAx1kOsu17X8a1cQbiBmkFZNcT2xweLkFuVMW+MN48 35iDNc7kZcMzCepsnw4Xq472zv9RDG+QO+uDcV7jsRaLFD6G++jkmDtVdmXu8tMpxOyL U68P8WNJMB2eGrHkd33TcYTJ+eixzM5Z1QXIs1eXhdw1tT0vtfTZ4GuqvEgUDMGaZvLu zQXA== X-Gm-Message-State: AElRT7EpfUeWGE/b1xj6uedsQyUvBRhEhBbFTuyRsYcsRwYP1BZvg6vR t7iGSD/TNpe6nPLl5r8/nfZQiCPZmWerYSe4lPxjFg== X-Received: by 10.176.71.214 with SMTP id w22mr1364278uac.74.1522207571844; Tue, 27 Mar 2018 20:26:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.129.9 with HTTP; Tue, 27 Mar 2018 20:26:11 -0700 (PDT) In-Reply-To: <1522128575-5326-13-git-send-email-yamada.masahiro@socionext.com> References: <1522128575-5326-1-git-send-email-yamada.masahiro@socionext.com> <1522128575-5326-13-git-send-email-yamada.masahiro@socionext.com> From: Kees Cook Date: Tue, 27 Mar 2018 20:26:11 -0700 X-Google-Sender-Auth: hnyWyUJ4m0wIqNkKLpXztGa9Pwk Message-ID: Subject: Re: [PATCH v2 12/21] kconfig: show compiler version text in the top comment To: Masahiro Yamada Cc: linux-kbuild , Sam Ravnborg , Linus Torvalds , Arnd Bergmann , Ulf Magnusson , Thomas Gleixner , Greg Kroah-Hartman , Randy Dunlap , "Luis R . Rodriguez" , Nicolas Pitre , LKML 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 On Mon, Mar 26, 2018 at 10:29 PM, Masahiro Yamada wrote: > 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 I like seeing this in the config. Good idea! Reviewed-by: Kees Cook -Kees > --- > > Changes in v2: None > > Kconfig | 2 ++ > Makefile | 2 ++ > 2 files changed, 4 insertions(+) > > 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. > -- > 2.7.4 > -- Kees Cook Pixel Security