From 048359fb0ed5b3c4f25aef28cb5a814e4c7a6686 Mon Sep 17 00:00:00 2001 From: Bernd Herzog Date: Tue, 16 Jul 2024 11:47:55 +0200 Subject: [PATCH] added --print-memory-usage to linker parameters (#2195) * added --print-memory-usage to linker parameters * included standalone apps --- firmware/application/CMakeLists.txt | 1 + firmware/baseband/CMakeLists.txt | 2 ++ firmware/standalone/pacman/CMakeLists.txt | 1 + 3 files changed, 4 insertions(+) diff --git a/firmware/application/CMakeLists.txt b/firmware/application/CMakeLists.txt index f8871aa4..5c31cad6 100644 --- a/firmware/application/CMakeLists.txt +++ b/firmware/application/CMakeLists.txt @@ -509,6 +509,7 @@ include_directories(. ${INCDIR}) link_directories(${LLIBDIR}) target_link_libraries(${PROJECT_NAME}.elf ${LIBS} "-L${CMAKE_CURRENT_LIST_DIR}/external") target_link_libraries(${PROJECT_NAME}.elf -Wl,-Map=${PROJECT_NAME}.map) +target_link_libraries(${PROJECT_NAME}.elf -Wl,--print-memory-usage) add_custom_command( OUTPUT ${PROJECT_NAME}.bin diff --git a/firmware/baseband/CMakeLists.txt b/firmware/baseband/CMakeLists.txt index 88d03452..5efc3687 100644 --- a/firmware/baseband/CMakeLists.txt +++ b/firmware/baseband/CMakeLists.txt @@ -278,7 +278,9 @@ macro(DeclareTargets chunk_tag name) include_directories(. ${INCDIR} ${MODE_INCDIR}) link_directories(${LLIBDIR}) target_link_libraries(${PROJECT_NAME}.elf ${LIBS}) + target_link_libraries(${PROJECT_NAME}.elf -Wl,-Map=${PROJECT_NAME}.map) + target_link_libraries(${PROJECT_NAME}.elf -Wl,--print-memory-usage) if(add_to_firmware) diff --git a/firmware/standalone/pacman/CMakeLists.txt b/firmware/standalone/pacman/CMakeLists.txt index 92ffabf1..30023db6 100644 --- a/firmware/standalone/pacman/CMakeLists.txt +++ b/firmware/standalone/pacman/CMakeLists.txt @@ -220,6 +220,7 @@ target_link_libraries(${PROJECT_NAME}.elf -Wl,-Map=${PROJECT_NAME}.map) # redirect std lib memory allocations target_link_libraries(${PROJECT_NAME}.elf "-Wl,-wrap,_malloc_r") target_link_libraries(${PROJECT_NAME}.elf "-Wl,-wrap,_free_r") +target_link_libraries(${PROJECT_NAME}.elf "-Wl,--print-memory-usage") add_custom_command( OUTPUT ${PROJECT_NAME}.ppmp