From patchwork Mon May 28 09:22:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 137053 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2594281lji; Mon, 28 May 2018 02:27:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLSCmuhPHUdfXCHwmz/QEC2bVyPJ8fNcHvxbkaxSe9Hclf+rKAR1+6UGdVFiyRjeR1AKM/s X-Received: by 2002:a17:902:566:: with SMTP id 93-v6mr2550003plf.385.1527499655504; Mon, 28 May 2018 02:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499655; cv=none; d=google.com; s=arc-20160816; b=S0A79zKmOsYfkt3cYxg4LupBRtsBzYdDBzNu4NnCqsWdchwQ2+qUW/rophPLS+mCfg faYIrV8782pqRbWmVdvjgWvJPoFzWz98Y6hdlnChVsX+XACFRZq+d3njuF1RGMxGjLGU vyg/tnqsdjpbkW/oLJtcPVZkIu6VYtkveCvunc1EqRKmSAEDBXJvNrFWTPkg4+Kzf+/8 QjBkK9qe5tW1iTlTEMSdjLdPbztGD4Bdo6ZOYOWd/QCNlF3bibANiU7vYz7hX5jrKbRl Z9+8Ypjt/RUAaehRB1blIV0ERye7h9YTzwwIzYcS3MHJb9h2gRvBqAteluc5joDd3aUE nMiQ== 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 k2-v6si1838978pgp.200.2018.05.28.02.27.35; Mon, 28 May 2018 02:27:35 -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 S933752AbeE1J1d (ORCPT + 30 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(+) -- 2.7.4 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