Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3583415imm; Mon, 13 Aug 2018 14:30:47 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx5qXCdP3hY7fwtP/PslWMjlbUWBXASFoJwuw1iLGUfBWOo2qqJagnBc0/oA9G0Fq3d89p2 X-Received: by 2002:a17:902:b60e:: with SMTP id b14-v6mr17866340pls.111.1534195847627; Mon, 13 Aug 2018 14:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534195847; cv=none; d=google.com; s=arc-20160816; b=NfKkn6oRmVNRX34GYhuqhpD0F4St425Nx9KwzS462OwXKjUK2yoCRrvZOho03v29+Z 6OFLxvJ9gd6Qs2xB5ykk/mV84Paz4rgb3kdeTvwCQRzsVOkFkWnuOxrSFUlu7xUCLo2Z U1YsxOh1JxMIIZ24jLYDWgOVeD7UMbcmSYRUgfNmzWMDdDdiHuGP+uF6HAYYw/Gm5k1+ 7IEiI/48PCMzaXfYytDKiauTjCAemz1vY9wrHGTADmfPs2M7TdSNoGbrEPZVJ5p4S2Mi drQ8pyTxJm7RufMBH1poF51NKvc+uwmfXDnmrNBp07pGIp+iuEnctcrs63U5sd1vngwG YeAg== 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=umEuTMeVa8Pt/+eq1xVQFH82L3hbj1TZaK5/+kNIyDQ=; b=VL8cpyPh7X5u2kFELsHe0q0nrlk5xQ40Uu2u77CUtlIcKgm12SS6ehn0a4W6OuOiBt fBZHuUewFu5r8GxGjuuU+kqs2tetMh0trJTV+mVfiPbfrsGt+9ARh+B2iR57GV3MR4d1 mmbA+Dih2mV/n2itSaxgU6JwzVsHveTDIemu0RtiimEF2HivywLQ48tiRNYgoYhJltMN 2xG9BOYlMBF+am6tUvqdoOnfX3NxeRV+dsC+tYPM7kWJ5UmzU0ykKlILk9NVxSf9Aj3I 722kGJqd0lMzTfEzTkYnKJ7I70HP1lDXr9MbT55zOjnUxIe7clGhsaZR1Y/7V87/wsfq rkMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=vHwvGgmG; 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 r29-v6si17808622pff.24.2018.08.13.14.30.32; Mon, 13 Aug 2018 14:30:47 -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=vHwvGgmG; 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 S1730326AbeHNANo (ORCPT + 99 others); Mon, 13 Aug 2018 20:13:44 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:41654 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729126AbeHNANn (ORCPT ); Mon, 13 Aug 2018 20:13:43 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 505C45C1E22; Mon, 13 Aug 2018 23:29:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1534195774; 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=umEuTMeVa8Pt/+eq1xVQFH82L3hbj1TZaK5/+kNIyDQ=; b=vHwvGgmG3depAURSBqaQj1QOW2q5wZS1eMmXSkC1Zs3273AIaSIMJaqvp+5Q5vV8mO+jQR D3rBlFx9Qdk+fWdvpKq/oPzWZ/7iiKT1On7DhMnmo+p717eq0jQPLdcBzuKbS3SqYWOwlY Zumzh3RFQvFhDrLiwwr4/ZFUuQucXnQ= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 13 Aug 2018 23:29:26 +0200 From: Stefan Agner To: Kees Cook Cc: Masahiro Yamada , Alexei Starovoitov , Andrew Morton , Josef Bacik , Emese Revfy , Linux Kernel Mailing List Subject: Re: [PATCH] gcc-plugins: require GCC In-Reply-To: References: <20180811094853.32167-1-stefan@agner.ch> Message-ID: <7aac5c23415baa357197d11d5ef7cf2f@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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... -- Stefan > > > -Kees