From 57e761f7242254e0a15d498972d87704c709b07e Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Sun, 26 Jul 2026 17:00:11 +0200 Subject: [PATCH] build: Omit default priority ELF symbol. Do not define nx_priority for applications that use SCHED_PRIORITY_DEFAULT. The ELF loader already uses its scheduler default when the symbol is absent, avoiding the invalid priority-zero value previously encoded by Application.mk. Keep emitting nx_priority, and retaining it through stripping, for explicit numeric priorities. Assisted-by: Zed:GPT-5.6 Terra Signed-off-by: Marco Casaroli --- Application.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Application.mk b/Application.mk index d950f698c..bc83121a9 100644 --- a/Application.mk +++ b/Application.mk @@ -146,10 +146,9 @@ ifneq ($(strip $(PROGNAME)),) # CONFIG_SCHED_USER_IDENTITY) so the binary loader can recover them. # Per-target so each PROGLIST entry picks up its own STACKSIZE_/PRIORITY_. - $(PROGLIST): SYM_PRIORITY = $(if $(filter SCHED_PRIORITY_DEFAULT,$(PRIORITY_$@)),0,$(PRIORITY_$@)) $(PROGLIST): MODLDFLAGS += \ $(if $(STACKSIZE_$@),--defsym nx_stacksize=$(STACKSIZE_$@)) \ - $(if $(PRIORITY_$@),--defsym nx_priority=$(SYM_PRIORITY)) + $(if $(filter-out SCHED_PRIORITY_DEFAULT,$(PRIORITY_$@)),--defsym nx_priority=$(PRIORITY_$@)) ifeq ($(CONFIG_SCHED_USER_IDENTITY),y) $(PROGLIST): MODLDFLAGS += \ $(if $(UID_$@),--defsym nx_uid=$(UID_$@)) \ @@ -159,7 +158,7 @@ endif # Keep the attribute symbols through --strip-unneeded so the binary loader # can still read them from the stripped runtime image in bin/. - $(PROGLIST): NX_KEEP = $(if $(STACKSIZE_$@),-K nx_stacksize) $(if $(PRIORITY_$@),-K nx_priority) $(if $(UID_$@),-K nx_uid) $(if $(GID_$@),-K nx_gid) $(if $(MODE_$@),-K nx_mode) + $(PROGLIST): NX_KEEP = $(if $(STACKSIZE_$@),-K nx_stacksize) $(if $(filter-out SCHED_PRIORITY_DEFAULT,$(PRIORITY_$@)),-K nx_priority) $(if $(UID_$@),-K nx_uid) $(if $(GID_$@),-K nx_gid) $(if $(MODE_$@),-K nx_mode) endif # Condition flags