1f80be457SAlexander Potapenko# SPDX-License-Identifier: GPL-2.0 2f80be457SAlexander Potapenko# 3f80be457SAlexander Potapenko# Makefile for KernelMemorySanitizer (KMSAN). 4f80be457SAlexander Potapenko# 5f80be457SAlexander Potapenko# 63c206509SAlexander Potapenkoobj-y := core.o instrumentation.o init.o hooks.o report.o shadow.o 7f80be457SAlexander Potapenko 8f80be457SAlexander PotapenkoKMSAN_SANITIZE := n 9f80be457SAlexander PotapenkoKCOV_INSTRUMENT := n 10f80be457SAlexander PotapenkoUBSAN_SANITIZE := n 11f80be457SAlexander Potapenko 12f80be457SAlexander Potapenko# Disable instrumentation of KMSAN runtime with other tools. 13f80be457SAlexander PotapenkoCC_FLAGS_KMSAN_RUNTIME := -fno-stack-protector 14f80be457SAlexander PotapenkoCC_FLAGS_KMSAN_RUNTIME += $(call cc-option,-fno-conserve-stack) 15f80be457SAlexander PotapenkoCC_FLAGS_KMSAN_RUNTIME += -DDISABLE_BRANCH_PROFILING 16f80be457SAlexander Potapenko 17*e75a6988SArnd Bergmann# Disable ftrace to avoid recursion. 18*e75a6988SArnd BergmannCFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE) 19*e75a6988SArnd BergmannCFLAGS_REMOVE_hooks.o = $(CC_FLAGS_FTRACE) 20*e75a6988SArnd BergmannCFLAGS_REMOVE_init.o = $(CC_FLAGS_FTRACE) 21*e75a6988SArnd BergmannCFLAGS_REMOVE_instrumentation.o = $(CC_FLAGS_FTRACE) 22*e75a6988SArnd BergmannCFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE) 23*e75a6988SArnd BergmannCFLAGS_REMOVE_shadow.o = $(CC_FLAGS_FTRACE) 24f80be457SAlexander Potapenko 25f80be457SAlexander PotapenkoCFLAGS_core.o := $(CC_FLAGS_KMSAN_RUNTIME) 26f80be457SAlexander PotapenkoCFLAGS_hooks.o := $(CC_FLAGS_KMSAN_RUNTIME) 273c206509SAlexander PotapenkoCFLAGS_init.o := $(CC_FLAGS_KMSAN_RUNTIME) 28f80be457SAlexander PotapenkoCFLAGS_instrumentation.o := $(CC_FLAGS_KMSAN_RUNTIME) 29f80be457SAlexander PotapenkoCFLAGS_report.o := $(CC_FLAGS_KMSAN_RUNTIME) 30f80be457SAlexander PotapenkoCFLAGS_shadow.o := $(CC_FLAGS_KMSAN_RUNTIME) 318ed691b0SAlexander Potapenko 328ed691b0SAlexander Potapenkoobj-$(CONFIG_KMSAN_KUNIT_TEST) += kmsan_test.o 338ed691b0SAlexander PotapenkoKMSAN_SANITIZE_kmsan_test.o := y 348ed691b0SAlexander PotapenkoCFLAGS_kmsan_test.o += $(call cc-disable-warning, uninitialized) 35