mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: Kees Cook <keescook@chromium.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Josef Bacik <jbacik@fb.com>, Emese Revfy <re.emese@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gcc-plugins: require GCC
Date: Mon, 13 Aug 2018 23:29:26 +0200	[thread overview]
Message-ID: <7aac5c23415baa357197d11d5ef7cf2f@agner.ch> (raw)
In-Reply-To: <CAGXu5jJ_XZ0Rwve_JKsWtPpdVDed4jYT=Qrg-XkmQqMuJZQmgQ@mail.gmail.com>

On 13.08.2018 22:18, Kees Cook wrote:
> On Mon, Aug 13, 2018 at 1:10 PM, Kees Cook <keescook@chromium.org> wrote:
>> On Mon, Aug 13, 2018 at 12:38 AM, Masahiro Yamada
>> <yamada.masahiro@socionext.com> wrote:
>>> 2018-08-11 18:48 GMT+09:00 Stefan Agner <stefan@agner.ch>:
>>>> Unsurprisingly GCC plugins require GCC as a compiler. This avoids
>>>> GCC plugins being selectable when using clang.
>>>>
>>>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>>>> ---
>>>>  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

  reply	other threads:[~2018-08-13 21:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-11  9:48 Stefan Agner
2018-08-13  7:38 ` Masahiro Yamada
2018-08-13 20:10   ` Kees Cook
2018-08-13 20:18     ` Kees Cook
2018-08-13 21:29       ` Stefan Agner [this message]
2018-08-14  2:28         ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7aac5c23415baa357197d11d5ef7cf2f@agner.ch \
    --to=stefan@agner.ch \
    --cc=akpm@linux-foundation.org \
    --cc=ast@kernel.org \
    --cc=jbacik@fb.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=re.emese@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®