Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2142463imm; Mon, 28 May 2018 02:28:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp7USqUKbwh0dfcjXb28R2dLvB1ZOc1Lsyxq7n1WvUu/7Bf5oT4/IY18HePor+8yiotzWkJ X-Received: by 2002:aa7:819a:: with SMTP id g26-v6mr12818749pfi.210.1527499725792; Mon, 28 May 2018 02:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499725; cv=none; d=google.com; s=arc-20160816; b=XnLZoFa/fctHAxamT6IaZOtFLaVLvCF0diG/wwKHTDtv8Im0+aRRR6AC9N6yGA1W3i qo5kQ8s853h+5m4GrYL/OYNo36AizCDzPyG3eksAox5F+zh/iPVHNmvK1McNEM/P20jl 3LitaZW2o7RqDhylGxYsFM4kCDHJVi3QHXV+Fer6zH/Gc2rvLKJjsrga4hkya2ixnMGh 4rp9IoFaWpIUid9Sd16+g6giOfwkpT9W4UhX3+0lg4/6jz3OUSD+MN0mxLC6/YW2GIP1 JS5kmgekiX7ONVA7KpLfA2sJuAHTXRGLkB5hAwzjjnJUhjqeaWkX31HUcSU7+1SiW3k9 R1jw== 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=rVhnJfkZ47h7Ex9lsCwIUrEW6C4miI37K3OhJdWZqeE=; b=Wy6YnF2/5Ed42NLOHtLu4AlXkfTM6gvuVSOdeCbhKTF7u1ThYsvbpdPRR0GKlC9S0s caN+gKNw3l+aDZsP/SZXKy2/JmipvFHbSEA0S8AhrQK/Kcj3mj4lQSg0FbTkCZxHAG5y cSm1905pmTPNkdSDZL1ZgJYg8GfEzRLruWY6VmqqtQ2oitXwbiF5IxnLDNXeAXTBnFa0 2ygWhlpQ2uUu8P1QXeBM8xkSgFOfuUU9VH3meeABrLPXinksTkL7gKrXljXSBuJ79Di9 e0go1ncHoGMSXRvem29GuwjOnqTrC29WupncSiXOjD2sq2kOYDkVH9gaIBcTTILFiGoL u0oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BBo3UJma; 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 1-v6si29320581plk.521.2018.05.28.02.28.31; Mon, 28 May 2018 02:28:45 -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=BBo3UJma; 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 S933656AbeE1J1d (ORCPT + 99 others); Mon, 28 May 2018 05:27:33 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:21768 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754373AbeE1JYU (ORCPT ); Mon, 28 May 2018 05:24:20 -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 w4S9MInf027506; Mon, 28 May 2018 18:22:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4S9MInf027506 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527499359; bh=rVhnJfkZ47h7Ex9lsCwIUrEW6C4miI37K3OhJdWZqeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BBo3UJmah8PRJRUn3QpX7HCY0+AuiE0Ldsfz7w2mC2yYdpbXdvaQ2z8MNTcrFMLpH uZ3j/mOu17rMnH4hG9hjkqZl80APdvt8n8qkXJmnjrTtCFz5cfa+JuRLXW5gUr3+dG OegCkm1WdRzr/sv12Cewz4APdf35fjP4Gw6B+97rzr/FCESMuziBoYs2rkel53w9Me shA4MV18EltHGo6skFZTWeBsxwNycU5jdqRA/YcinnQl04vOuTU5u3+VQ1PUo01SkC 6UAY1KH5oql+p/b/v4U3UP4BhGd7LijYkeRacIC9rknben3JEbOxnMoQacCGm/F9bn 9yNC2N03M0Lvg== 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 24/31] kconfig: add CC_IS_GCC and GCC_VERSION Date: Mon, 28 May 2018 18:22:01 +0900 Message-Id: <1527499328-13213-25-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 This will be useful to specify the required compiler version, like this: config FOO bool "Use Foo" depends on GCC_VERSION >= 40800 help This feature requires GCC 4.8 or newer. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None init/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init/Kconfig b/init/Kconfig index f1b0cfb..2e33d93 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -8,6 +8,14 @@ config DEFCONFIG_LIST default ARCH_DEFCONFIG default "arch/$(ARCH)/defconfig" +config CC_IS_GCC + def_bool $(success,$(CC) --version | grep -q gcc) + +config GCC_VERSION + int + default $(shell,$(srctree)/scripts/gcc-version.sh -p $(CC) | sed 's/^0*//') if CC_IS_GCC + default 0 + config CONSTRUCTORS bool depends on !UML -- 2.7.4