Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933621AbcCNVEz (ORCPT ); Mon, 14 Mar 2016 17:04:55 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:35692 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932609AbcCNVEw (ORCPT ); Mon, 14 Mar 2016 17:04:52 -0400 Date: Mon, 14 Mar 2016 22:02:47 +0100 From: Emese Revfy To: Masahiro Yamada Cc: Linux Kbuild mailing list , pageexec@freemail.hu, spender@grsecurity.net, kernel-hardening@lists.openwall.com, Michal Marek , Kees Cook , Rasmus Villemoes , fengguang.wu@intel.com, Dmitry Vyukov , Linux Kernel Mailing List Subject: Re: [PATCH v5 3/5] Add Cyclomatic complexity GCC plugin Message-Id: <20160314220247.5d4ea9efe0024820599435d4@gmail.com> In-Reply-To: References: <20160307000208.1bec3e7dc874489d1b4fcbb4@gmail.com> <20160307000531.d43ae7df74bfa5e9e9e29087@gmail.com> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.29; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1513 Lines: 40 On Fri, 11 Mar 2016 15:26:39 +0900 Masahiro Yamada wrote: > > diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins > > index 7c85bf2..dd7b56d 100644 > > --- a/scripts/Makefile.gcc-plugins > > +++ b/scripts/Makefile.gcc-plugins > > @@ -5,7 +5,11 @@ else > > PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(HOSTCXX)" "$(CC)") > > endif > > ifneq ($(PLUGINCC),) > > -export PLUGINCC GCC_PLUGINS_CFLAGS GCC_PLUGINS_AFLAGS > > +ifdef CONFIG_GCC_PLUGIN_CYC_COMPLEXITY > > +GCC_PLUGIN_CYC_COMPLEXITY_CFLAGS := -fplugin=$(objtree)/tools/gcc/cyc_complexity_plugin.so > > +endif > > +GCC_PLUGINS_CFLAGS := $(GCC_PLUGIN_CYC_COMPLEXITY_CFLAGS) > > +export PLUGINCC GCC_PLUGINS_CFLAGS GCC_PLUGINS_AFLAGS GCC_PLUGIN_CYC_COMPLEXITY > > > Do you need to export "GCC_PLUGIN_CYC_COMPLEXITY"? > I do not see any reference to it. This is a demo plugin. I just want to demonstrate how to use this infrastructure but I can remove it. In my project there would be other plugins which use the export. > If we expect more and more plugins in the future, > is it better to do like this? > > gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so > gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so > gcc-plugin-$(CONFIG_GCC_PLUGIN_FOO) += foo_plugin.so > > > GCC_PLUGINS_CFLAGS := $(addprefix -fplugin=$(objtree)/tools/gcc/, > $(gcc-plugin-y)) Yes, it is better, I will do it. -- Emese