From 370a95837903f1d05b6d90382239034b31c321ea Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 12 Apr 2023 00:18:06 +0300 Subject: [PATCH] BuildSystem: GCC will now complain on functions with 1 KiB stack --- kernel/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 09cc6fa14..cea44e174 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -50,6 +50,8 @@ set(KERNEL_SOURCES icxxabi.cpp ) +#set(ENABLE_KERNEL_UBSAN True) + if(ENABLE_KERNEL_UBSAN) set(KERNEL_SOURCES ${KERNEL_SOURCES} ubsan.cpp) endif() @@ -106,7 +108,7 @@ target_compile_definitions(kernel PUBLIC __arch=${BANAN_ARCH}) target_compile_options(kernel PUBLIC -O2 -g) target_compile_options(kernel PUBLIC -Wno-literal-suffix) target_compile_options(kernel PUBLIC -fno-rtti -fno-exceptions) -target_compile_options(kernel PUBLIC -fstack-protector -ffreestanding -Wall -Wextra -Werror=return-type -fno-omit-frame-pointer -mno-sse -mno-sse2) +target_compile_options(kernel PUBLIC -fstack-protector -ffreestanding -Wall -Wextra -Werror=return-type -Wstack-usage=1024 -fno-omit-frame-pointer -mno-sse -mno-sse2) if(ENABLE_KERNEL_UBSAN) target_compile_options(kernel PUBLIC -fsanitize=undefined)