This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit eb2f66117075b66515fc065cda72595ff9e03ec6
Author: W-M-R <[email protected]>
AuthorDate: Wed Oct 2 12:43:14 2024 +0800

    make/kasan: Added cmake toolchain compilation options about kasan for arm64 
architecture
    
    Signed-off-by: W-M-R <[email protected]>
---
 arch/arm64/src/cmake/Toolchain.cmake | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/src/cmake/Toolchain.cmake 
b/arch/arm64/src/cmake/Toolchain.cmake
index 0978a15f1f..38113dba40 100644
--- a/arch/arm64/src/cmake/Toolchain.cmake
+++ b/arch/arm64/src/cmake/Toolchain.cmake
@@ -123,6 +123,18 @@ if(CONFIG_MM_KASAN_ALL)
   add_compile_options(-fsanitize=kernel-address)
 endif()
 
+if(CONFIG_MM_KASAN_GLOBAL)
+  add_compile_options(--param=asan-globals=1)
+endif()
+
+if(CONFIG_MM_KASAN_DISABLE_READS_CHECK)
+  add_compile_options(--param=asan-instrument-reads=0)
+endif()
+
+if(CONFIG_MM_KASAN_DISABLE_WRITES_CHECK)
+  add_compile_options(--param=asan-instrument-writes=0)
+endif()
+
 if(CONFIG_ARCH_INSTRUMENT_ALL)
   add_compile_options(-finstrument-functions)
 endif()

Reply via email to