This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 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 cbb107abb9f arch/arm64: Do not list arm64_perf.o twice in the build
rules.
cbb107abb9f is described below
commit cbb107abb9fc3854789a423a80d01aebf0fd226b
Author: Marco Casaroli <[email protected]>
AuthorDate: Mon Oct 12 05:45:56 2026 +0200
arch/arm64: Do not list arm64_perf.o twice in the build rules.
With ARCH_HAVE_PERF_EVENTS_USER_ACCESS (Cortex-R82), arm64_perf.c is in
both the kernel and the user source lists, and make warns that the
target is given more than once in the same rule:
Makefile:142: target 'arm64_perf.o' given more than once in the same rule
A flat build has no user library, so add the user copy only to
non-flat builds, as armv7-r does and as CMake already does. A
protected build needs both copies, so the object rules now sort their
object lists, which also removes the duplicate names.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
---
arch/arm64/src/Makefile | 4 ++--
arch/arm64/src/common/Make.defs | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/src/Makefile b/arch/arm64/src/Makefile
index 28cbe46a1d0..52bb3d04065 100644
--- a/arch/arm64/src/Makefile
+++ b/arch/arm64/src/Makefile
@@ -136,10 +136,10 @@ vpath nuttx$(EXEEXT) $(TOPDIR)
all: $(HEAD_OBJ) $(BIN)
-$(AOBJS) $(UAOBJS) $(HEAD_OBJ): %$(OBJEXT): %.S
+$(sort $(AOBJS) $(UAOBJS) $(HEAD_OBJ)): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
-$(COBJS) $(UCOBJS): %$(OBJEXT): %.c
+$(sort $(COBJS) $(UCOBJS)): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(STARTUP_OBJS): %$(OBJEXT): %.c
diff --git a/arch/arm64/src/common/Make.defs b/arch/arm64/src/common/Make.defs
index 4bef36a3b1c..05b7f5a90ab 100644
--- a/arch/arm64/src/common/Make.defs
+++ b/arch/arm64/src/common/Make.defs
@@ -159,5 +159,7 @@ ifeq ($(CONFIG_ARM64_SEMIHOSTING_HOSTFS),y)
endif
ifeq ($(CONFIG_ARCH_HAVE_PERF_EVENTS_USER_ACCESS),y)
- CMN_UCSRCS += arm64_perf.c
+ ifneq ($(CONFIG_BUILD_FLAT),y)
+ CMN_UCSRCS += arm64_perf.c
+ endif
endif