Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp3834542ooa; Mon, 13 Aug 2018 19:31:37 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwshdJxEOVs61BPT9yMvfHR9johCfFy6FI2qiie8SC/y4Dq7m4COKf16p2FGXlaDZBpA0ML X-Received: by 2002:a17:902:e85:: with SMTP id 5-v6mr18510755plx.73.1534213897389; Mon, 13 Aug 2018 19:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534213897; cv=none; d=google.com; s=arc-20160816; b=FR3qjVTdyXoZ0rqZK+k2wD8HeNqRNdWjpLnIsCHgfHl/DQjo6ApkRyrtF2M4BT6Xg5 +NWzXfH2s3mUnbI7mDbr1WZQvzRf94P3H6zO5fmUvzi5OZvAmEklE3+HEzac4UW6+jN+ XmCKVH3wUdOwnBxCaPdS35o9XmRHzdwODRPEUc5Cbygico4x4iNbcayav+h3HVU7oY9n B1EAHMjRI60gux9hSPNYn1egv0FZRJkc8gTMCvcWNYOx2FWMbYF0Tf5+xqkFVyr9Bjq0 zzkSqY3vzmfLKId1EqTLeQy/fG53tkky3/Lc8ePVZN8ynHsqS6P/1rLtStFB7/xyxAM9 F6Dw== 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=XD0xCrJagqP7YLdbWOWgS4FU/L6VI7PvNv0CL1Bj45Y=; b=zME1W/oG62zLtUtvk99HE5bw8iKI4OHCFVv8mJPa/KSDLCVPWXvfIsHYqFZx6JZeO5 JPt7CqNK51t16PIgaMCY1RYf7DK4EaZtlfvVRA5AZNIbXX7zmsI5VLJdNgkRj0IGTNXn 8x8r9GqkxAfqZQl4YEd2pNRG0WqFVsuxzzswx57lbd417wR2WYa/QGHXRxTH9P76xzNL XV5fdYTOnoYhFW0NSJLUzUQ8hLKKutOr2GM/aNlj/AMNQbDyGRLQdV2xKsQg/C3A7/yi UuYx8ZliGWq1upeNIGpyStwl8WKT78xx0/jT+MyAO04JDjy7dx3yD0sVdGyM3mqdV5IA wPVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Dp57EzJW; 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 j38-v6si17827234pgj.613.2018.08.13.19.31.08; Mon, 13 Aug 2018 19:31:37 -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=Dp57EzJW; 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 S1730119AbeHNFO2 (ORCPT + 99 others); Tue, 14 Aug 2018 01:14:28 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:25277 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbeHNFO2 (ORCPT ); Tue, 14 Aug 2018 01:14:28 -0400 Received: from mail-ua1-f42.google.com (mail-ua1-f42.google.com [209.85.222.42]) (authenticated) by conssluserg-02.nifty.com with ESMTP id w7E2T6f4016158 for ; Tue, 14 Aug 2018 11:29:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com w7E2T6f4016158 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1534213747; bh=XD0xCrJagqP7YLdbWOWgS4FU/L6VI7PvNv0CL1Bj45Y=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=Dp57EzJWQxAaefZqeKY++tTC3Jz9aH5szsQCCSsRyFFIM1RsatybxCXf6jTCYxcLh HOiaSE0CKT187JgksoXpRgdNCdy8OYKh0Z5w8iFv6qm8wxy9dNWDR2PGVFKb3yPxD8 T7vsKNLPX05ky+zE5eB1dHz6im/IJIYTXAgfCLAu5GKlEAmZM0PH74HPZBxzl5DtMC V0BP5w7D/wx1EdK9ZBs6SR8JOSEFCBMmKd0nfFG/gQR5R9uWbMgJNwCfPMP8SnS3gH amm0bXF7wEDrlf5FkG8ftYyg87Bjrfz4QiKgoOXPMQO77BiEH/Z8uYvyKYj49k7E/i rSgAEiRVRxJPw== X-Nifty-SrcIP: [209.85.222.42] Received: by mail-ua1-f42.google.com with SMTP id o11-v6so11516594uak.5 for ; Mon, 13 Aug 2018 19:29:07 -0700 (PDT) X-Gm-Message-State: AOUpUlGkCsOCj3NtsrID50SQwNRDmBOxuOZy1p+p8UGKlQy0RWz0xLoJ 0NaCje7DunHfEYmZfSkNUcBuinf/crPvgQBlwzI= X-Received: by 2002:ab0:4705:: with SMTP id h5-v6mr13019764uac.140.1534213746198; Mon, 13 Aug 2018 19:29:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:2642:0:0:0:0:0 with HTTP; Mon, 13 Aug 2018 19:28:25 -0700 (PDT) In-Reply-To: <7aac5c23415baa357197d11d5ef7cf2f@agner.ch> References: <20180811094853.32167-1-stefan@agner.ch> <7aac5c23415baa357197d11d5ef7cf2f@agner.ch> From: Masahiro Yamada Date: Tue, 14 Aug 2018 11:28:25 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] gcc-plugins: require GCC To: Stefan Agner Cc: Kees Cook , Alexei Starovoitov , Andrew Morton , Josef Bacik , Emese Revfy , Linux Kernel Mailing List 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-08-14 6:29 GMT+09:00 Stefan Agner : > On 13.08.2018 22:18, Kees Cook wrote: >> On Mon, Aug 13, 2018 at 1:10 PM, Kees Cook wrote: >>> On Mon, Aug 13, 2018 at 12:38 AM, Masahiro Yamada >>> wrote: >>>> 2018-08-11 18:48 GMT+09:00 Stefan Agner : >>>>> Unsurprisingly GCC plugins require GCC as a compiler. This avoids >>>>> GCC plugins being selectable when using clang. >>>>> >>>>> Signed-off-by: Stefan Agner >>>>> --- >>>>> arch/Kconfig | 2 +- >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>> >>>>> diff --git a/arch/Kconfig b/arch/Kconfig >>>>> index 1aa59063f1fd..8c693a837ed7 100644 >>>>> --- a/arch/Kconfig >>>>> +++ b/arch/Kconfig >>>>> @@ -422,7 +422,7 @@ config HAVE_GCC_PLUGINS >>>>> >>>>> menuconfig GCC_PLUGINS >>>>> bool "GCC plugins" >>>>> - depends on HAVE_GCC_PLUGINS >>>>> + depends on HAVE_GCC_PLUGINS && CC_IS_GCC >>>>> depends on PLUGIN_HOSTCC != "" >>>>> help >>>>> GCC plugins are loadable modules that provide extra features to the >>>>> -- >>>>> 2.18.0 >>>>> >>>> >>>> I guess the more correct way is to fix >>>> scripts/gcc-plugin.sh >>>> >>>> This shell script should exit 0 >>>> only when GCC plugin is supported. >>> >>> I'm of two minds: we already have the gcc test in Kconfig so we might >>> want to avoid redundant checks, but maybe the script should be a >>> "complete" test. I guess the latter. I will send a patch. >> >> Actually, how about we do the test in Kconfig, but ahead of the >> script? That will reduce redundancy: >> >> diff --git a/arch/Kconfig b/arch/Kconfig >> index 1aa59063f1fd..18f518624e41 100644 >> --- a/arch/Kconfig >> +++ b/arch/Kconfig >> @@ -409,7 +409,7 @@ preferred-plugin-hostcc := $(if-success,[ >> $(gcc-version) -ge 40800 ],$(HOSTCXX), >> >> config PLUGIN_HOSTCC >> string >> - default "$(shell,$(srctree)/scripts/gcc-plugin.sh >> "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" >> + default "$(shell,$(srctree)/scripts/gcc-plugin.sh >> "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" if CC_IS_GCC >> help >> Host compiler used to build GCC plugins. This can be $(HOSTCXX), >> $(HOSTCC), or a null string if GCC plugin is unsupported. > > I like this better. A script which is called gcc-plugin.sh should only > be called if gcc is used... > This does not work like that. $(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)") is expanded in the parse stage regardless of CC_IS_GCC. If nobody comes up with a better way, I am fine with this. Reviewed-by: Masahiro Yamada > -- > Stefan > >> >> >> -Kees -- Best Regards Masahiro Yamada