mirror of
https://github.com/torvalds/linux.git
synced 2024-12-20 01:52:13 +00:00
543c37cb16
The sancov gcc plugin inserts a __sanitizer_cov_trace_pc() call at the start of basic blocks. This plugin is a helper plugin for the kcov feature. It supports all gcc versions with plugin support (from gcc-4.5 on). It is based on the gcc commit "Add fuzzing coverage support" by Dmitry Vyukov (https://gcc.gnu.org/viewcvs/gcc?limit_changes=0&view=revision&revision=231296). Signed-off-by: Emese Revfy <re.emese@gmail.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Michal Marek <mmarek@suse.com>
28 lines
814 B
Makefile
28 lines
814 B
Makefile
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
|
|
|
|
export GCCPLUGINS_DIR HOSTLIBS
|
|
|
|
ifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN))
|
|
GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN))
|
|
endif
|
|
|
|
$(HOSTLIBS)-y := $(GCC_PLUGIN)
|
|
always := $($(HOSTLIBS)-y)
|
|
|
|
cyc_complexity_plugin-objs := cyc_complexity_plugin.o
|
|
sancov_plugin-objs := sancov_plugin.o
|
|
|
|
clean-files += *.so
|