diff --git a/mm/kasan/CMakeLists.txt b/mm/kasan/CMakeLists.txt index 8252112e34..3f7e32d668 100644 --- a/mm/kasan/CMakeLists.txt +++ b/mm/kasan/CMakeLists.txt @@ -25,6 +25,7 @@ if(CONFIG_MM_KASAN) list(APPEND SRCS generic.c) set_source_files_properties(generic.c PROPERTIES COMPILE_FLAGS -fno-sanitize=kernel-address) + set_source_files_properties(generic.c PROPERTIES COMPILE_FLAGS -fno-builtin) set_source_files_properties(generic.c PROPERTIES COMPILE_FLAGS -fno-lto) endif() diff --git a/mm/kasan/Make.defs b/mm/kasan/Make.defs index a2a15b6a03..bc8e0c5696 100644 --- a/mm/kasan/Make.defs +++ b/mm/kasan/Make.defs @@ -43,6 +43,8 @@ ifeq ($(CONFIG_MM_KASAN),y) endif endif +CFLAGS += -fno-builtin + # Add the core heap directory to the build DEPPATH += --dep-path kasan