Configure kernel stack size for release build based on architecture

This commit is contained in:
Zejun Zhao 2025-08-28 22:58:08 +08:00 committed by Junyang Zhang
parent b9a0878d53
commit 4b26eb05aa
1 changed files with 8 additions and 1 deletions

View File

@ -83,7 +83,14 @@ CARGO_OSDK_COMMON_ARGS += --profile release-lto
OSTD_TASK_STACK_SIZE_IN_PAGES = 8
else ifeq ($(RELEASE), 1)
CARGO_OSDK_COMMON_ARGS += --release
OSTD_TASK_STACK_SIZE_IN_PAGES = 16
ifeq ($(OSDK_TARGET_ARCH), riscv64)
# FIXME: Unwinding in RISC-V seems to cost more stack space, so we increase
# the stack size for it. This may need further investigation.
# See https://github.com/asterinas/asterinas/pull/2383#discussion_r2307673156
OSTD_TASK_STACK_SIZE_IN_PAGES = 16
else
OSTD_TASK_STACK_SIZE_IN_PAGES = 8
endif
endif
# If the BENCHMARK is set, we will run the benchmark in the kernel mode.