nuttx/mm: fix cmake kasan flags
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
parent
496e44db7f
commit
38010adc02
|
@ -22,11 +22,21 @@
|
||||||
set(SRCS hook.c)
|
set(SRCS hook.c)
|
||||||
|
|
||||||
if(CONFIG_MM_KASAN)
|
if(CONFIG_MM_KASAN)
|
||||||
|
list(APPEND FLAGS -fno-builtin)
|
||||||
|
if(CONFIG_MM_KASAN_GENERIC)
|
||||||
list(APPEND SRCS generic.c)
|
list(APPEND SRCS generic.c)
|
||||||
set_source_files_properties(generic.c PROPERTIES COMPILE_FLAGS
|
list(APPEND FLAGS -fno-sanitize=kernel-address)
|
||||||
-fno-sanitize=kernel-address)
|
endif()
|
||||||
set_source_files_properties(generic.c PROPERTIES COMPILE_FLAGS -fno-builtin)
|
|
||||||
set_source_files_properties(generic.c PROPERTIES COMPILE_FLAGS -fno-lto)
|
if(CONFIG_MM_KASAN_SW_TAGS)
|
||||||
|
list(APPEND SRCS sw_tags.c)
|
||||||
|
list(APPEND FLAGS -fno-sanitize=kernel-hwaddress)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_LTO_NONE)
|
||||||
|
list(APPEND FLAGS -fno-lto)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_sources(mm PRIVATE ${SRCS})
|
target_sources(mm PRIVATE ${SRCS})
|
||||||
|
target_compile_options(mm PRIVATE ${FLAGS})
|
||||||
|
|
Loading…
Reference in New Issue