This is an automated email from the ASF dual-hosted git repository.
xiaoxiang 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 c1bcf59a85 libs/libc: fix build break on kernel mode
c1bcf59a85 is described below
commit c1bcf59a85ef8201daa321a76c919141cfec8acc
Author: chao an <[email protected]>
AuthorDate: Tue Jun 6 09:29:53 2023 +0800
libs/libc: fix build break on kernel mode
Signed-off-by: chao an <[email protected]>
---
libs/libc/sched/Make.defs | 5 ++---
sched/pthread/pthread_create.c | 3 ++-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libs/libc/sched/Make.defs b/libs/libc/sched/Make.defs
index 70b95c614f..9c639bc20d 100644
--- a/libs/libc/sched/Make.defs
+++ b/libs/libc/sched/Make.defs
@@ -32,13 +32,12 @@ ifeq ($(CONFIG_SMP),y)
CSRCS += sched_cpucount.c
endif
-ifneq ($(CONFIG_BUILD_KERNEL),y)
-CSRCS += task_startup.c
-
ifeq ($(CONFIG_SCHED_BACKTRACE),y)
CSRCS += sched_dumpstack.c sched_backtrace.c
endif
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+CSRCS += task_startup.c
endif # CONFIG_BUILD_KERNEL
# Add the sched directory to the build
diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c
index 14ce51ba1f..81072c255e 100644
--- a/sched/pthread/pthread_create.c
+++ b/sched/pthread/pthread_create.c
@@ -369,7 +369,8 @@ 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)
+#if defined(CONFIG_ARCH_ADDRENV) && \
+ defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_ARCH_KERNEL_STACK)
/* Allocate the kernel stack */
ret = up_addrenv_kstackalloc(&ptcb->cmn);