File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -492,6 +492,7 @@ $(obj)/core.o: $(RUST_LIB_SRC)/core/src/lib.rs \
492
492
ifneq ($(or $(CONFIG_X86_64 ) ,$(CONFIG_X86_32 ) ) ,)
493
493
$(obj ) /core.o : scripts/target.json
494
494
endif
495
+ KCOV_INSTRUMENT_core.o := n
495
496
496
497
$(obj ) /compiler_builtins.o : private skip_gendwarfksyms = 1
497
498
$(obj ) /compiler_builtins.o : private rustc_objcopy = -w -W '__* '
Original file line number Diff line number Diff line change @@ -3,4 +3,10 @@ kcov-flags-$(CONFIG_CC_HAS_SANCOV_TRACE_PC) += -fsanitize-coverage=trace-pc
3
3
kcov-flags-$(CONFIG_KCOV_ENABLE_COMPARISONS) += -fsanitize-coverage=trace-cmp
4
4
kcov-flags-$(CONFIG_GCC_PLUGIN_SANCOV) += -fplugin=$(objtree)/scripts/gcc-plugins/sancov_plugin.so
5
5
6
+ kcov-rflags-y += -Cpasses=sancov-module
7
+ kcov-rflags-y += -Cllvm-args=-sanitizer-coverage-level=3
8
+ kcov-rflags-y += -Cllvm-args=-sanitizer-coverage-trace-pc
9
+ kcov-rflags-$(CONFIG_KCOV_ENABLE_COMPARISONS) += -Cllvm-args=-sanitizer-coverage-trace-compares
10
+
6
11
export CFLAGS_KCOV := $(kcov-flags-y)
12
+ export RUSTFLAGS_KCOV := $(kcov-rflags-y)
Original file line number Diff line number Diff line change @@ -169,6 +169,9 @@ ifeq ($(CONFIG_KCOV),y)
169
169
_c_flags += $(if $(patsubst n%,, \
170
170
$(KCOV_INSTRUMENT_$(target-stem).o)$(KCOV_INSTRUMENT)$(if $(is-kernel-object),$(CONFIG_KCOV_INSTRUMENT_ALL))), \
171
171
$(CFLAGS_KCOV))
172
+ _rust_flags += $(if $(patsubst n%,, \
173
+ $(KCOV_INSTRUMENT_$(target-stem).o)$(KCOV_INSTRUMENT)$(if $(is-kernel-object),$(CONFIG_KCOV_INSTRUMENT_ALL))), \
174
+ $(RUSTFLAGS_KCOV))
172
175
endif
173
176
174
177
#
You can’t perform that action at this time.
0 commit comments