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 committed by Randy Mackay
parent f7d5f0f8f1
commit 73e5c2b4a8
2 changed files with 6 additions and 0 deletions

View File

@ -120,5 +120,8 @@ 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)

View File

@ -120,4 +120,7 @@ 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)