diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c27ab870d..13151b9001 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,6 +169,10 @@ if(CONFIG_COMPILER_DUMP_RTL_FILES) list(APPEND compile_options "-fdump-rtl-expand") endif() +if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 15.0) + list(APPEND c_compile_options "-fzero-init-padding-bits=all") +endif() + __generate_prefix_map(prefix_map_compile_options) list(APPEND compile_options ${prefix_map_compile_options})