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 23ea1503a19 mips/Makefile: Add nuttx build with CONFIG_ALLSYMS enabled.
23ea1503a19 is described below
commit 23ea1503a19118bd8d2b80a3579f0c3bc579ab86
Author: 22078360 <[email protected]>
AuthorDate: Tue Aug 11 15:18:28 2026 +0800
mips/Makefile: Add nuttx build with CONFIG_ALLSYMS enabled.
Change the arch/mips/src/Makefile to build nuttx with CONFIG_ALLSYMS
enabled in MIPS architecture. This enables symbol name showing in
system, such as 'dumpstack 3' shows both functions name and addresses.
This change is referred to arch/tricore/src/Makefile and updated to
work well with MIPS. And it works with and without CONFIG_ALLSYMS enabled.
Fixes apache#19728
Signed-off-by: wangtao <[email protected]>
---
arch/mips/src/Makefile | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/mips/src/Makefile b/arch/mips/src/Makefile
index 4cf636f2fa9..aef7c538c4b 100644
--- a/arch/mips/src/Makefile
+++ b/arch/mips/src/Makefile
@@ -89,11 +89,29 @@ libarch$(LIBEXT): $(OBJS)
board/libboard$(LIBEXT):
$(Q) $(MAKE) -C board libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)"
+define LINK_ALLSYMS
+ $(Q) $(TOPDIR)/tools/mkallsyms.py $(NUTTX) allsyms.tmp --orderbyname
$(CONFIG_SYMTAB_ORDEREDBYNAME)
+ $(Q) $(call COMPILE, allsyms.tmp, allsyms$(OBJEXT), -x c)
+ $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
+ -o $(NUTTX) $(HEAD_OBJ) allsyms$(OBJEXT) $(EXTRA_OBJS) \
+ $(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
+ $(Q) $(call DELFILE, allsyms.tmp allsyms$(OBJEXT))
+endef
+
nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT) $(ARCHSCRIPT)
@echo "LD: nuttx"
+ifneq ($(CONFIG_ALLSYMS),y)
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
+else
+ $(Q) # Link and generate default table
+ $(Q) $(if $(wildcard $(shell echo $(NUTTX))),,$(call LINK_ALLSYMS,$^))
+ $(Q) # Extract all symbols
+ $(Q) $(call LINK_ALLSYMS, $^)
+ $(Q) # Extract again since the table offset may changed
+ $(Q) $(call LINK_ALLSYMS, $^)
+endif
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) $(NM) $(NUTTX) | \
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw]
\)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \