feat(build): support KASAN in the build system v2 (cmakev2)

Mirror Kernel Address Sanitizer support into cmakev2 so that
CONFIG_COMPILER_KASAN instruments application code the same way build system v1
does.
This commit is contained in:
Sudeep Mohanty
2026-07-31 11:01:02 +02:00
parent cc799dbcc7
commit 9c778c954c
6 changed files with 166 additions and 31 deletions

View File

@@ -96,6 +96,10 @@ idf_build_set_property(SET_COMPILER_OPTIMIZATION NO)
# file name, which LTO does not preserve, so it must never be compiled or linked
# with LTO regardless of the application's CONFIG_COMPILER_LTO_* options.
idf_build_set_property(SET_COMPILER_LTO NO)
# The bootloader runs before kasan_init_shadow() and carries no sanitizer
# runtime, so it must never be instrumented regardless of the application's
# CONFIG_COMPILER_KASAN option.
idf_build_set_property(SET_COMPILER_KASAN NO)
# Perform internal IDF project initialisation
idf_project_init()