You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2025/02/01 16:20:18 UTC
(nuttx) branch master updated: arch/xtensa: Add --print-memory-usage to LDFLAGS in Toolchain.defs
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new e043658d1e arch/xtensa: Add --print-memory-usage to LDFLAGS in Toolchain.defs
e043658d1e is described below
commit e043658d1e2c3124e375d1133e090f55abd2c6ab
Author: Huang Qi <hu...@xiaomi.com>
AuthorDate: Sat Feb 1 18:51:34 2025 +0800
arch/xtensa: Add --print-memory-usage to LDFLAGS in Toolchain.defs
Summary:
- Added `--print-memory-usage` to `LDFLAGS` in `Toolchain.defs` for both `lx6` and `lx7` architectures
- This flag enables memory usage reporting during the linking phase, providing better visibility into memory allocation
Impact:
- No functional changes - the flag only adds additional debug information during the build process
- Improves debugging and optimization capabilities by providing detailed memory usage statistics
- Maintains compatibility with existing build configurations and toolchains
Testing:
Test result on esp32s3:
```
Memory region Used Size Region Size %age Used
ROM: 556116 B 16777184 B 3.31%
iram0_0_seg: 23296 B 304 KB 7.48%
irom0_0_seg: 621652 B 16777184 B 3.71%
dram0_0_seg: 85780 B 288 KB 29.09%
drom0_0_seg: 157180 B 16777184 B 0.94%
rtc_iram_seg: 0 B 8168 B 0.00%
rtc_data_seg: 0 B 8168 B 0.00%
rtc_reserved_seg: 0 B 24 B 0.00%
rtc_slow_seg: 0 B 8 KB 0.00%
```
Signed-off-by: Huang Qi <hu...@xiaomi.com>
---
arch/xtensa/src/lx6/Toolchain.defs | 2 ++
arch/xtensa/src/lx7/Toolchain.defs | 2 ++
2 files changed, 4 insertions(+)
diff --git a/arch/xtensa/src/lx6/Toolchain.defs b/arch/xtensa/src/lx6/Toolchain.defs
index 18b713d6dc..8488e53475 100644
--- a/arch/xtensa/src/lx6/Toolchain.defs
+++ b/arch/xtensa/src/lx6/Toolchain.defs
@@ -181,6 +181,8 @@ NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
+LDFLAGS += --print-memory-usage
+
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),)
ifeq ($(GCCVER),)
diff --git a/arch/xtensa/src/lx7/Toolchain.defs b/arch/xtensa/src/lx7/Toolchain.defs
index 3328478542..51b1e4755d 100644
--- a/arch/xtensa/src/lx7/Toolchain.defs
+++ b/arch/xtensa/src/lx7/Toolchain.defs
@@ -185,6 +185,8 @@ NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
+LDFLAGS += --print-memory-usage
+
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),)
ifeq ($(GCCVER),)