]> granicus.if.org Git - esp-idf/commitdiff
esp32: disable stack protector for startup code (CMake)
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 29 Jan 2019 09:41:00 +0000 (17:41 +0800)
committerbot <bot@espressif.com>
Tue, 5 Mar 2019 07:11:57 +0000 (07:11 +0000)
Files where stack protector is initialized should not be compiled with
stack protector enabled. This was done for Make but missing for CMake.

Fixes https://github.com/espressif/esp-idf/issues/2990.

components/esp32/CMakeLists.txt

index eb2012964d80392980849d528e7522a27f63ce9d..5416ad225685f7b4ec9767aa4aede598b9d05290 100644 (file)
@@ -142,4 +142,9 @@ else()
 
     endif()
 
+    # disable stack protection in files which are involved in initialization of that feature
+    set_source_files_properties(
+        stack_check.c cpu_start.c
+        PROPERTIES COMPILE_FLAGS
+        -fno-stack-protector)
 endif()