diff options
author | Emese Revfy <re.emese@gmail.com> | 2016-06-26 11:38:20 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2016-08-08 20:53:05 -0400 |
commit | caefd8c9a9fb06811e07bf3571e5d4450846b16a (patch) | |
tree | 675552008567fe3ce2cfe99a83ab1dce23e5e323 /scripts/gcc-plugins | |
parent | 7040c83bfbaf2340d2f336dc7641ce909c8c2b4c (diff) |
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/Makefile | 9 |
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 | |||
12 | export HOST_EXTRACXXFLAGS | 12 | export HOST_EXTRACXXFLAGS |
13 | endif | 13 | endif |
14 | 14 | ||
15 | export GCCPLUGINS_DIR HOSTLIBS | ||
16 | |||
17 | ifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN)) | 15 | ifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN)) |
18 | GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN)) | 16 | GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN)) |
19 | endif | 17 | endif |
20 | 18 | ||
21 | $(HOSTLIBS)-y := $(GCC_PLUGIN) | 19 | export HOSTLIBS |
20 | |||
21 | $(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p))) | ||
22 | always := $($(HOSTLIBS)-y) | 22 | always := $($(HOSTLIBS)-y) |
23 | 23 | ||
24 | $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o)) | 24 | $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o)) |
25 | 25 | ||
26 | subdir-y := $(GCC_PLUGIN_SUBDIR) | ||
27 | subdir- += $(GCC_PLUGIN_SUBDIR) | ||
28 | |||
26 | clean-files += *.so | 29 | clean-files += *.so |