diff --git a/arch/Kconfig b/arch/Kconfig index 0ddcdb50c40..1eb8f833636 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -907,7 +907,7 @@ endif # ARCH_STACK_DYNAMIC config ARCH_KERNEL_STACK bool "Kernel process stack" default LIBC_EXECFUNCS - depends on BUILD_KERNEL + depends on BUILD_KERNEL || BUILD_PROTECTED ---help--- It this option is selected, then every user process will have two stacks: A large, potentially dynamically sized user stack and small diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index 0ab0ba9f3fd..d608fdaf8cc 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -273,8 +273,7 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread, goto errout_with_tcb; } -#if defined(CONFIG_ARCH_ADDRENV) && \ - defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_ARCH_KERNEL_STACK) +#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_ARCH_KERNEL_STACK) /* Allocate the kernel stack */ ret = up_addrenv_kstackalloc(ptcb);