From 00285cbd8d4d1e6a6361c4c2472ddcbc4967589f Mon Sep 17 00:00:00 2001 From: "liang.huang" Date: Sun, 12 Jul 2026 07:59:53 +0800 Subject: [PATCH] nshlib: apply configured priority/stacksize under CONFIG_BUILD_KERNEL nsh_fileapp() ignored an application's configured priority/stacksize under CONFIG_BUILD_KERNEL, since the registry table it reads was gated on CONFIG_BUILTIN, which depends on !BUILD_KERNEL. Switch builtin/Make.defs and nsh_fileapps.c to the new CONFIG_APP_REGISTRY symbol (nuttx side) so the lookup works under CONFIG_BUILD_KERNEL. exec_builtin.c stays on CONFIG_BUILTIN since it still dereferences builtin->main. Signed-off-by: liang.huang --- builtin/Make.defs | 2 +- builtin/Makefile | 5 ++++- nshlib/nsh_fileapps.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/builtin/Make.defs b/builtin/Make.defs index 47d1bf96004..b59d86e6afc 100644 --- a/builtin/Make.defs +++ b/builtin/Make.defs @@ -20,6 +20,6 @@ # ############################################################################ -ifneq ($(CONFIG_BUILTIN),) +ifneq ($(CONFIG_APP_REGISTRY),) CONFIGURED_APPS += $(APPDIR)/builtin endif diff --git a/builtin/Makefile b/builtin/Makefile index a5de31f6c5e..a551b6ef156 100644 --- a/builtin/Makefile +++ b/builtin/Makefile @@ -24,7 +24,10 @@ include $(APPDIR)/Make.defs # Source and object files -CSRCS = builtin_list.c exec_builtin.c +CSRCS = builtin_list.c +ifeq ($(CONFIG_BUILTIN),y) +CSRCS += exec_builtin.c +endif # Registry entry lists diff --git a/nshlib/nsh_fileapps.c b/nshlib/nsh_fileapps.c index 66f41e36fc8..e889ce32205 100644 --- a/nshlib/nsh_fileapps.c +++ b/nshlib/nsh_fileapps.c @@ -79,7 +79,7 @@ int nsh_fileapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, pid_t pid; int rc = 0; int ret; -#ifdef CONFIG_BUILTIN +#ifdef CONFIG_APP_REGISTRY FAR char *appname; int index; #endif @@ -212,7 +212,7 @@ int nsh_fileapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, } } -#ifdef CONFIG_BUILTIN +#ifdef CONFIG_APP_REGISTRY /* Check if a builtin application with this name exists */ appname = basename((FAR char *)cmd);