2016-05-24 06:09:38 +08:00
|
|
|
GCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
|
|
|
|
|
|
|
|
ifeq ($(PLUGINCC),$(HOSTCC))
|
|
|
|
HOSTLIBS := hostlibs
|
|
|
|
HOST_EXTRACFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu99 -ggdb
|
|
|
|
export HOST_EXTRACFLAGS
|
|
|
|
else
|
|
|
|
HOSTLIBS := hostcxxlibs
|
|
|
|
HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
|
|
|
|
HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
|
|
|
|
HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable
|
|
|
|
export HOST_EXTRACXXFLAGS
|
|
|
|
endif
|
|
|
|
|
2016-05-24 06:11:37 +08:00
|
|
|
ifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN))
|
|
|
|
GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN))
|
|
|
|
endif
|
|
|
|
|
2016-06-26 23:38:20 +08:00
|
|
|
export HOSTLIBS
|
|
|
|
|
2017-05-06 14:37:45 +08:00
|
|
|
$(obj)/randomize_layout_plugin.o: $(objtree)/$(obj)/randomize_layout_seed.h
|
|
|
|
quiet_cmd_create_randomize_layout_seed = GENSEED $@
|
|
|
|
cmd_create_randomize_layout_seed = \
|
|
|
|
$(CONFIG_SHELL) $(srctree)/$(src)/gen-random-seed.sh $@ $(objtree)/include/generated/randomize_layout_hash.h
|
|
|
|
$(objtree)/$(obj)/randomize_layout_seed.h: FORCE
|
|
|
|
$(call if_changed,create_randomize_layout_seed)
|
|
|
|
targets = randomize_layout_seed.h randomize_layout_hash.h
|
|
|
|
|
2016-06-26 23:38:20 +08:00
|
|
|
$(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
|
2016-05-24 06:09:38 +08:00
|
|
|
always := $($(HOSTLIBS)-y)
|
|
|
|
|
2016-06-26 23:36:43 +08:00
|
|
|
$(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
|
2016-05-24 06:11:37 +08:00
|
|
|
|
2016-06-26 23:38:20 +08:00
|
|
|
subdir-y := $(GCC_PLUGIN_SUBDIR)
|
|
|
|
subdir- += $(GCC_PLUGIN_SUBDIR)
|
|
|
|
|
2016-05-24 06:09:38 +08:00
|
|
|
clean-files += *.so
|