[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jJ_XZ0Rwve_JKsWtPpdVDed4jYT=Qrg-XkmQqMuJZQmgQ@mail.gmail.com>
Date: Mon, 13 Aug 2018 13:18:22 -0700
From: Kees Cook <keescook@...omium.org>
To: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: Stefan Agner <stefan@...er.ch>,
Alexei Starovoitov <ast@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Josef Bacik <jbacik@...com>, Emese Revfy <re.emese@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gcc-plugins: require GCC
On Mon, Aug 13, 2018 at 1:10 PM, Kees Cook <keescook@...omium.org> wrote:
> On Mon, Aug 13, 2018 at 12:38 AM, Masahiro Yamada
> <yamada.masahiro@...ionext.com> wrote:
>> 2018-08-11 18:48 GMT+09:00 Stefan Agner <stefan@...er.ch>:
>>> Unsurprisingly GCC plugins require GCC as a compiler. This avoids
>>> GCC plugins being selectable when using clang.
>>>
>>> Signed-off-by: Stefan Agner <stefan@...er.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.
-Kees
--
Kees Cook
Pixel Security
Powered by blists - more mailing lists