diff --git a/Makefile b/Makefile index fd809bc15..19e63b994 100644 --- a/Makefile +++ b/Makefile @@ -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.