From 21d0c65e52ee0ac807d0670b2b9e5b037c068236 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Thu, 25 Jan 2024 11:12:21 +0800 Subject: [PATCH] fix(system): fixed -fstack-protector issue on P4 During cpu_start stack-smashing would errorounsly trigger when compiled with -Os on P4. This happened due to the stack canary value (stored in bss) changing when we initialized bss and then getting flagged as a stackoverflow. Disable fstack-protector for cpu_start to avoid this issue --- components/esp_system/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_system/CMakeLists.txt b/components/esp_system/CMakeLists.txt index 53bab1f35a..78e7fe079e 100644 --- a/components/esp_system/CMakeLists.txt +++ b/components/esp_system/CMakeLists.txt @@ -86,7 +86,7 @@ else() # Disable stack protection in files which are involved in initialization of that feature set_source_files_properties( - "startup.c" "stack_check.c" + "startup.c" "stack_check.c" "port/cpu_start.c" PROPERTIES COMPILE_FLAGS -fno-stack-protector)