diff --git a/arch/posix/CMakeLists.txt b/arch/posix/CMakeLists.txt index e02686fa29..ef28857979 100644 --- a/arch/posix/CMakeLists.txt +++ b/arch/posix/CMakeLists.txt @@ -159,8 +159,8 @@ endif() # (supported by current gcc's as well) # if(CONFIG_CFI) - zephyr_compile_options(-flto) - target_compile_options(native_simulator INTERFACE "-flto") + zephyr_compile_options(-flto -fvisibility=hidden) + target_compile_options(native_simulator INTERFACE "-flto -fvisibility=hidden") target_link_options(native_simulator INTERFACE "-flto") list(APPEND LLVM_SANITIZERS "cfi") endif() diff --git a/samples/basic/blinky/prj.conf b/samples/basic/blinky/prj.conf index 65722b4a06..d6d76a49d3 100644 --- a/samples/basic/blinky/prj.conf +++ b/samples/basic/blinky/prj.conf @@ -1,4 +1,8 @@ CONFIG_GPIO=y -CONFIG_ASAN=y +#CONFIG_ASAN=y CONFIG_CFI=y #CONFIG_LLVM_USE_LLD=y + +CONFIG_DEBUG=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_OPTIMIZATIONS=y diff --git a/subsys/debug/Kconfig b/subsys/debug/Kconfig index 969d304a9c..58839a7feb 100644 --- a/subsys/debug/Kconfig +++ b/subsys/debug/Kconfig @@ -110,7 +110,7 @@ config GPROF config CFI bool "Build with control flow integrity sanitizer" - depends on ARCH_POSIX + depends on help Builds Zephyr with Address Sanitizer enabled. This is currently only supported by boards based on the posix architecture, and requires a