mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
mm/kasan: fix build fail when CONFIG_MM_KASAN_GLOBAL and CONFIG_BUILD_KERNEL on
When CONFIG_MM_KASAN_GLOBAL is enabled, hook.c is also linked into libmm.a. However, g_global_region (defined in global.c) is only injected into the nuttx ELF by kasan_global.py — it does not process the app binary. This causes undefined symbol errors when linking an app against libmm.a. Guard the inclusion of global.c with __KERNEL__ so that only kernel builds pull in the global KASAN region, while app builds fall back to the no-op stub. Signed-off-by: leisiji <2265215145@qq.com>
This commit is contained in:
parent
51d0848b74
commit
7253e70659
1 changed files with 1 additions and 1 deletions
|
|
@ -31,7 +31,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef CONFIG_MM_KASAN_GLOBAL
|
||||
#if defined(CONFIG_MM_KASAN_GLOBAL) && defined(__KERNEL__)
|
||||
# include "global.c"
|
||||
#else
|
||||
# define kasan_global_is_poisoned(addr, size) false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue