Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp151507imm; Mon, 4 Jun 2018 14:51:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIkweGj801pe3Lh+rLag7Rh7Uk36g1fuF9iauz/jrgOQbdm0YR/zmzBpvHS/alGX5Tzq/N1 X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr23309700plz.336.1528149083499; Mon, 04 Jun 2018 14:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528149083; cv=none; d=google.com; s=arc-20160816; b=ZLEg35ZerHEp1k+/FPwuKPEwhC5OvalnB5e0UAExfdm+NxCMphfBPVP5uqcAt+O4DG rZJquAACl3TP0m7qHeYsJKPgimlSY01kSM28JEXBjCAsQ8dHl5jACSfFba8/uPiF6qTf nFBziKyypxgp9g9AxCH0NFvGMYdXpmkyW43lmffvx/QSjgNnfMWEFBn/ss62CgPSv/J2 CNAFbgrDi69xCuF8vU/3BmwpdZB/ZNNPJEbgceXNS6NN7wtdE5TnkEG6mx6gAJSd21gy K0PrUOdYu2ly4fGdhpWXcXNwpn7sZCcrhGcwMWD0C6z3jdH/CciGJwDLB1EsD8PNXk5L tevw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=ST2tB2jLxQ6uRXUyUoYrWC7o+p9nnWK+yZ7EYKIjGeY=; b=BV/CwG88im19Nascg76ep+1wNyvNQvOMSvBv606iyGNcTOZgnSWG2juU2EgMnkd++2 TJtRcuSQhi4kndVGAMZ0OKt0WlGk32LdGFz3GN11gnB9H8J4PRghsDOZwb05Vg6vFACP 3Df9JIIbxHedpXgyB1HLdRvmLwt/+5DeJ2d0zmjikdbI+AgTcbmPlavDJKcbbhK9NxP+ kYb4G4gZ/YHUYLysZ2au0ocQQq1J2Dh6CP0kmqrstuCk4H0daew810ALPTXN2uTCAXH9 M50EccfFbRmuw33FYKQakHijE8Is2w8OZxsAECNXcInWs+klfT6qT6tw5L+Eosz4lNV5 wLNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=WUjcuYQb; 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 199-v6si16474496pgd.74.2018.06.04.14.51.08; Mon, 04 Jun 2018 14:51:23 -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=@agner.ch header.s=dkim header.b=WUjcuYQb; 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 S1751748AbeFDVtY (ORCPT + 99 others); Mon, 4 Jun 2018 17:49:24 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:52616 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbeFDVtW (ORCPT ); Mon, 4 Jun 2018 17:49:22 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id C2CF05C0479; Mon, 4 Jun 2018 23:49:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1528148960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ST2tB2jLxQ6uRXUyUoYrWC7o+p9nnWK+yZ7EYKIjGeY=; b=WUjcuYQbGZSxHTuWKH8JQXdBu04xrF8ISFhcwKNMQJX5SKtH4/VQKXYZuEDjy9SJhhTHVg gdjN/1nFfgKvTYWNBTaeb+m0F3C2UOZaKEbDUE4sKW0CYFkJ6pU5MPp/Mdvi1Hl2glcE3l geNGx2s4vxMv4Tud+WEr/6AgbzcRy/A= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 04 Jun 2018 23:49:18 +0200 From: Stefan Agner To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Nicholas Piggin , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Linus Torvalds , linux-kbuild-owner@vger.kernel.org Subject: Re: [PATCH v5 24/31] kconfig: add CC_IS_GCC and GCC_VERSION In-Reply-To: <1527499328-13213-25-git-send-email-yamada.masahiro@socionext.com> References: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> <1527499328-13213-25-git-send-email-yamada.masahiro@socionext.com> Message-ID: X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [-3.10 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[11]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:29691, ipnet:2a02:418::/29, country:CH]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro, On 28.05.2018 11:22, Masahiro Yamada wrote: > 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. > I tried using CC_IS_GCC today while using clang. It seems that it is set to y despite I am using CC=clang. .config looks like this after config: ... CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=40201 CONFIG_CC_IS_CLANG=y CONFIG_CLANG_VERSION=60000 ... I am using clang 6.0.0 on Arch Linux, which seems to return a version when using gcc-version.sh: ./scripts/gcc-version.sh clang | sed 's/^0*//' 402 I guess that should not be the case? -- Stefan > 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