AP_HAL_ESP32: ensure malloc is wrapped to zero memory

The relevant linker flag needed to be put in the CMake script.
This commit is contained in:
Thomas Watson 2025-01-04 16:11:33 -06:00
parent 94aa4fc808
commit ed08a6a0bc
2 changed files with 6 additions and 0 deletions

View File

@ -121,6 +121,9 @@ target_link_libraries(${elf_file}
# linker script generation, partition_table generation, etc.
idf_build_executable(${elf_file})
# wrap malloc to ensure memory is zeroed
target_link_options(${elf_file} PRIVATE "-Wl,--wrap,malloc")
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# Additional targets for measuring RAM use: size, size-components, size-files

View File

@ -121,6 +121,9 @@ target_link_libraries(${elf_file}
# linker script generation, partition_table generation, etc.
idf_build_executable(${elf_file})
# wrap malloc to ensure memory is zeroed
target_link_options(${elf_file} PRIVATE "-Wl,--wrap,malloc")
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# Additional targets for measuring RAM use: size, size-components, size-files