Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp525830imm; Mon, 4 Jun 2018 23:29:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLw7GPaDcfIhBnZImYqG6uzZHzUAZoFrrhOKE/lYfZawIYkXyjAcTfkwVdq/33Fua7T+1A9 X-Received: by 2002:a62:4785:: with SMTP id p5-v6mr23874886pfi.164.1528180166406; Mon, 04 Jun 2018 23:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528180166; cv=none; d=google.com; s=arc-20160816; b=XdoyBIaAyIQ+TP3MWEuiKkumG3rjb8+/LJo0lXNqYY6zgTGHwQFgmBwOdt5o11wIJg L694OHI6dgEY1ncihMRvWprzCq4XKADPTcnckYBXZ4QfEZE+dWyeSg7dCXjvmyCsL5+o n1GTdymYVbE5n/eBKgu2igRrTtO6fiSgEbKkbbu5qH3EkPa02l9Gb/e0aFl0wwDPkgjF HmzY4ZQRkCsFuHlbv5Rpb9pyQHTHp23B/FUondXoKGN4eXUJ5O8iHuBN7314txWoVcWI cHjq/jKvjL9jO+c66KGQEqQurvpI32GAH/U7QedFj0l9Z9iUeU+utgoWCd5rFpDF9A3q XulQ== 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-filter :arc-authentication-results; bh=quCBzpdW9uEv8QKNk8qvl4bdcMWB892ske46q3IBLJ0=; b=ablVIQz1xEk0ZPnaleCD/fE9jiBqlVqfzNeBvYSN48g0zm06sdIyurWwXPdRmhbCV8 pbWxkNmQPPcQGb71Oqc3Gc3e0eBxF9UuYI8NIwVf1kYWS3UkWJeGPLRYP7aw8M9q3hFP vqPcXV0JvpQ0U1GS2DSwMFYYygD+3KqAk/3RN/TJbyJ6JAiJvOBntmO+oH8LVC6Z2Uak 7lpVwaN5nGthuV7RxY1w/wh0Xbw5RKgJomShNpnnSMAdXtYZGSTIqcsuR+fm11NLpSzU M0v3rLMQoGVhkaPLDhRj8zlEqFWqOSc3GMC53K+qddEYeCtG07il3pDtGqLzesyRVDiC 3leg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rw9dH4tV; 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 b2-v6si8319481plz.118.2018.06.04.23.29.12; Mon, 04 Jun 2018 23:29:26 -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=rw9dH4tV; 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 S1751566AbeFEG2m (ORCPT + 99 others); Tue, 5 Jun 2018 02:28:42 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:42627 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750788AbeFEG2l (ORCPT ); Tue, 5 Jun 2018 02:28:41 -0400 X-Greylist: delayed 22788 seconds by postgrey-1.27 at vger.kernel.org; Tue, 05 Jun 2018 02:28:40 EDT Received: from mail-ua0-f175.google.com (mail-ua0-f175.google.com [209.85.217.175]) (authenticated) by conssluserg-05.nifty.com with ESMTP id w556SQZo013269; Tue, 5 Jun 2018 15:28:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com w556SQZo013269 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1528180107; bh=quCBzpdW9uEv8QKNk8qvl4bdcMWB892ske46q3IBLJ0=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=rw9dH4tVznnypvGYlSzjJ7qiTnnflDeqAipP2LEWBXIR3eZ0DPU11FgmQe/K8EC9b SLwTSAwOWDanwL/B+rjV4N55hsAFhbPw21yXHSPtTFeLwj6N04KmQCMk87rKt5x67R DbFOOZxfrnxzdoLCb96IaHPScv4cyuaSreUmb8uS0TjRwYfnIWO1WIZ9NCf8nAM5/6 FHl6KkqiEdAO8N5WxMOL6om/B9Cnmxc25B2vmtqkWwza01PjO5fawgGtERWsRarG0I b4O51zCGvKMzrlxhNpSKjp6I7WE19Wx2zp7weXAFHdEHdSDSv2sl6yv8SHQthE3pkD dBPepJ8t60xCg== X-Nifty-SrcIP: [209.85.217.175] Received: by mail-ua0-f175.google.com with SMTP id e8-v6so776202uam.13; Mon, 04 Jun 2018 23:28:27 -0700 (PDT) X-Gm-Message-State: APt69E0lUE93gvNyTwbkWVlh/wlYFI8adGAaIppVsqUPLTfz4R7MgXma Efa9tolSJz9jgwH6XLUwVTiV+8p2sWAz06dfqvU= X-Received: by 2002:ab0:15ad:: with SMTP id i42-v6mr7079267uae.199.1528180105978; Mon, 04 Jun 2018 23:28:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:20ab:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 23:27:45 -0700 (PDT) In-Reply-To: <9a58f4b4e488a3bfc41aba39bc73f8ff@agner.ch> References: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> <1527499328-13213-25-git-send-email-yamada.masahiro@socionext.com> <9a58f4b4e488a3bfc41aba39bc73f8ff@agner.ch> From: Masahiro Yamada Date: Tue, 5 Jun 2018 15:27:45 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 24/31] kconfig: add CC_IS_GCC and GCC_VERSION To: Stefan Agner 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 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 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) 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