Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp630059imm; Tue, 5 Jun 2018 01:39:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK3sTlFG4J4NZIB+aJnezA627L0H168xXHh/ajluY8DLQbfR81x8ROfzqGd0/jujbzpiiv5 X-Received: by 2002:a65:44c8:: with SMTP id g8-v6mr12346635pgs.356.1528187986831; Tue, 05 Jun 2018 01:39:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528187986; cv=none; d=google.com; s=arc-20160816; b=oY0mUplqb9saDb+SiV/PNToNuzlauEXB8qouzNiW+FpakfrOx2Q+8FvOOVZtdTS/Y2 o7UCX1xI63faTxmlJvVGQl3RarnaOas7rVCwK8Dxos98n2CxfK6xgTcbh2eB1jnHATYi UdDdQRg29tggH3RwG72935foeg+YUMK4WOOAMOJTImtjeGrwe0bXDZCLpzGJSGYa9+nt 8KxDoNgjQyQgxH7cbEWBn9RHsvFPTWVwPpBxQLkI+z+Uf2lj+yAjFiZXyYbShtsS93Qp YIHkjMMQi6qn2sK8fAif2oOMCb1GKxy6liUeDYCdsG4r+fDEexgCZkroo6WfBOjgDrNd pg6Q== 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=3nNYW7BeNwRjoEdFy8a7rPSdCYmzkYKar9sQEb3NpaM=; b=BKjEOwrcHX81ykjSwrmo+U0y3Oy2OSSKDFArjGOal899hKuBGEO3zmLiyjA/aJKx+t 59G1SyT1vvNzg7XhFmRMPstXLJ+PT7bXBLGfA8EHBY1jlmoZSTdEwnXDBM3hH43wC9D/ NmA4aCzKbx78q/kMaLN2CWhGoxJoNaHhz6zOs5ZBSjlwgI16IUEO32RtQ3JU9MI5FnkN vQVed3Sq2HuE7+3Yy8UxLHy+FxK/uREhnYg8F6bceg8zieBpqjr58LSJiP5X6nAfmqAC mFbLC+QRhiXnX/b6zkecgUISw1ex0L7TU3KgSJDHGyaEnJhjdw2Zk1W+bVdCvsRg/vvo xe2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=N7L//8QP; 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 bc12-v6si3342689plb.373.2018.06.05.01.39.32; Tue, 05 Jun 2018 01:39:46 -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=N7L//8QP; 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 S1751880AbeFEIhc (ORCPT + 99 others); Tue, 5 Jun 2018 04:37:32 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:56590 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbeFEIha (ORCPT ); Tue, 5 Jun 2018 04:37:30 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 5594C5C011F; Tue, 5 Jun 2018 10:37:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1528187848; 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=3nNYW7BeNwRjoEdFy8a7rPSdCYmzkYKar9sQEb3NpaM=; b=N7L//8QP/bF+vBqt/1DGPiB8V1FH6b3MgvS+v09XKAUtXqOCO9qUAaIY6oXDYFd6YdklkR d0aBs0t1B3aIWeRhcTbITadUoGbk5GzSvxDFvTq4BL20z3nUF3zDBOopldAEuN2vcZN+iF lBx445v6SCvvURx6oNKg8csIN9VFezo= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Tue, 05 Jun 2018 10:37:27 +0200 From: Stefan Agner To: Masahiro Yamada Cc: Linux Kbuild mailing list , Linux Kernel Mailing List , 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: References: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> <1527499328-13213-25-git-send-email-yamada.masahiro@socionext.com> <9a58f4b4e488a3bfc41aba39bc73f8ff@agner.ch> Message-ID: X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [-3.04 / 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]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.94)[99.75%]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.06.2018 08:27, Masahiro Yamada wrote: > 2018-06-05 14:50 GMT+09:00 Stefan Agner : >> On 05.06.2018 02:07, Masahiro Yamada wrote: >>> Hi Stefan >>> >>> 2018-06-05 6:49 GMT+09:00 Stefan Agner : >>>> 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? >>>> >>> >>> >>> What will 'clang --version' print on your machine? >> >> $ clang --version >> clang version 6.0.0 (tags/RELEASE_600/final) >> Target: x86_64-pc-linux-gnu >> Thread model: posix >> InstalledDir: >> /home/ags/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin >> >> I use a symlink to clang in my cross compiler toolchain, that is why >> InstalledDir points to a GCC toolchain. >> > > Ah, I see. > > > I will fix it up like follows: > > > diff --git a/init/Kconfig b/init/Kconfig > index e5a0d89..efc43c6 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -9,7 +9,7 @@ config DEFCONFIG_LIST > default "arch/$(ARCH)/defconfig" > > config CC_IS_GCC > - def_bool $(success,$(CC) --version | grep -q gcc) > + def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc) Yes that works for me: ... CONFIG_GCC_VERSION=0 CONFIG_CC_IS_CLANG=y CONFIG_CLANG_VERSION=60000 ... -- Stefan > > config GCC_VERSION > int > @@ -17,7 +17,7 @@ config GCC_VERSION > default 0 > > config CC_IS_CLANG > - def_bool $(success,$(CC) --version | grep -q clang) > + def_bool $(success,$(CC) --version | head -n 1 | grep -q clang) > > config CLANG_VERSION > int > > > > > Best Regards > Masahiro Yamada