summaryrefslogtreecommitdiffstats
path: root/scripts/gcc-plugins
diff options
context:
space:
mode:
authorEmese Revfy <re.emese@gmail.com>2016-06-26 17:38:20 +0200
committerKees Cook <keescook@chromium.org>2016-08-08 17:53:05 -0700
commitcaefd8c9a9fb06811e07bf3571e5d4450846b16a (patch)
tree675552008567fe3ce2cfe99a83ab1dce23e5e323 /scripts/gcc-plugins
parent7040c83bfbaf2340d2f336dc7641ce909c8c2b4c (diff)
downloadblackbird-op-linux-caefd8c9a9fb06811e07bf3571e5d4450846b16a.tar.gz
blackbird-op-linux-caefd8c9a9fb06811e07bf3571e5d4450846b16a.zip
gcc-plugins: Add support for plugin subdirectories
This adds support for building more complex gcc plugins that live in a subdirectory instead of just in a single source file. Reported-by: PaX Team <pageexec@freemail.hu> Signed-off-by: Emese Revfy <re.emese@gmail.com> [kees: clarified commit message] Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'scripts/gcc-plugins')
-rw-r--r--scripts/gcc-plugins/Makefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile
index ee0a75d2a1c7..8b29dc17c73c 100644
--- a/scripts/gcc-plugins/Makefile
+++ b/scripts/gcc-plugins/Makefile
@@ -12,15 +12,18 @@ else
export HOST_EXTRACXXFLAGS
endif
-export GCCPLUGINS_DIR HOSTLIBS
-
ifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN))
GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN))
endif
-$(HOSTLIBS)-y := $(GCC_PLUGIN)
+export HOSTLIBS
+
+$(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
always := $($(HOSTLIBS)-y)
$(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
+subdir-y := $(GCC_PLUGIN_SUBDIR)
+subdir- += $(GCC_PLUGIN_SUBDIR)
+
clean-files += *.so
OpenPOWER on IntegriCloud