mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
kasan: disable the built-in 'memset' function
In function kasan_set_poison:
{
...
while (size--)
{
p[size] = value;
}
}
This will optimize to 'memset' function when compile option > O2.
But the memset must be instrument by kasan, so there is recursive
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -25,6 +25,7 @@ if(CONFIG_MM_KASAN)
|
|||||||
list(APPEND SRCS generic.c)
|
list(APPEND SRCS generic.c)
|
||||||
set_source_files_properties(generic.c PROPERTIES COMPILE_FLAGS
|
set_source_files_properties(generic.c PROPERTIES COMPILE_FLAGS
|
||||||
-fno-sanitize=kernel-address)
|
-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)
|
set_source_files_properties(generic.c PROPERTIES COMPILE_FLAGS -fno-lto)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ ifeq ($(CONFIG_MM_KASAN),y)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CFLAGS += -fno-builtin
|
||||||
|
|
||||||
# Add the core heap directory to the build
|
# Add the core heap directory to the build
|
||||||
|
|
||||||
DEPPATH += --dep-path kasan
|
DEPPATH += --dep-path kasan
|
||||||
|
|||||||
Reference in New Issue
Block a user