2022-09-15 15:03:45 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
#
|
|
|
|
# Makefile for KernelMemorySanitizer (KMSAN).
|
|
|
|
#
|
|
|
|
#
|
2022-09-15 15:03:51 +00:00
|
|
|
obj-y := core.o instrumentation.o init.o hooks.o report.o shadow.o
|
2022-09-15 15:03:45 +00:00
|
|
|
|
|
|
|
KMSAN_SANITIZE := n
|
|
|
|
KCOV_INSTRUMENT := n
|
|
|
|
UBSAN_SANITIZE := n
|
|
|
|
|
|
|
|
# Disable instrumentation of KMSAN runtime with other tools.
|
|
|
|
CC_FLAGS_KMSAN_RUNTIME := -fno-stack-protector
|
|
|
|
CC_FLAGS_KMSAN_RUNTIME += $(call cc-option,-fno-conserve-stack)
|
|
|
|
CC_FLAGS_KMSAN_RUNTIME += -DDISABLE_BRANCH_PROFILING
|
|
|
|
|
2023-02-15 13:00:57 +00:00
|
|
|
# Disable ftrace to avoid recursion.
|
|
|
|
CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE)
|
|
|
|
CFLAGS_REMOVE_hooks.o = $(CC_FLAGS_FTRACE)
|
|
|
|
CFLAGS_REMOVE_init.o = $(CC_FLAGS_FTRACE)
|
|
|
|
CFLAGS_REMOVE_instrumentation.o = $(CC_FLAGS_FTRACE)
|
|
|
|
CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE)
|
|
|
|
CFLAGS_REMOVE_shadow.o = $(CC_FLAGS_FTRACE)
|
2022-09-15 15:03:45 +00:00
|
|
|
|
|
|
|
CFLAGS_core.o := $(CC_FLAGS_KMSAN_RUNTIME)
|
|
|
|
CFLAGS_hooks.o := $(CC_FLAGS_KMSAN_RUNTIME)
|
2022-09-15 15:03:51 +00:00
|
|
|
CFLAGS_init.o := $(CC_FLAGS_KMSAN_RUNTIME)
|
2022-09-15 15:03:45 +00:00
|
|
|
CFLAGS_instrumentation.o := $(CC_FLAGS_KMSAN_RUNTIME)
|
|
|
|
CFLAGS_report.o := $(CC_FLAGS_KMSAN_RUNTIME)
|
|
|
|
CFLAGS_shadow.o := $(CC_FLAGS_KMSAN_RUNTIME)
|
2022-09-15 15:03:58 +00:00
|
|
|
|
|
|
|
obj-$(CONFIG_KMSAN_KUNIT_TEST) += kmsan_test.o
|
|
|
|
KMSAN_SANITIZE_kmsan_test.o := y
|
|
|
|
CFLAGS_kmsan_test.o += $(call cc-disable-warning, uninitialized)
|