From 7eb9bb0be6e9a8d205a44ac54d1c9ebf2da38041 Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Mon, 27 Jul 2026 03:49:01 +0200 Subject: [PATCH] cmake: Omit default priority ELF symbol. nuttx_add_application() encoded SCHED_PRIORITY_DEFAULT as a zero-valued nx_priority linker symbol. A zero priority is invalid for a runnable ELF application task. Do not emit nx_priority for the symbolic default. When the symbol is absent, the ELF loader retains its scheduler default. Continue emitting nx_priority for explicit numeric priorities. Companion to apache/nuttx-apps#3667. Assisted-by: Zed:GPT-5.6 Terra Signed-off-by: Marco Casaroli --- cmake/nuttx_add_application.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmake/nuttx_add_application.cmake b/cmake/nuttx_add_application.cmake index c670bf00d54..78c27c6e2a8 100644 --- a/cmake/nuttx_add_application.cmake +++ b/cmake/nuttx_add_application.cmake @@ -153,10 +153,7 @@ function(nuttx_add_application) set(SYMBOL_STACKSIZE $<$>:-Wl,>--defsym nx_stacksize=${STACKSIZE}) endif() - if(PRIORITY) - if(PRIORITY STREQUAL "SCHED_PRIORITY_DEFAULT") - set(PRIORITY "0") - endif() + if(PRIORITY AND NOT PRIORITY STREQUAL "SCHED_PRIORITY_DEFAULT") set(SYMBOL_PRIORITY $<$>:-Wl,>--defsym nx_priority=${PRIORITY}) endif()