]> 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)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 29 Jan 2019 09:41:00 +0000 (17:41 +0800)
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 dfbd4b2c960fe79f2a84afde25058cd505702e6b..36ccbd55ed80925af0f5a22554dccf4a2ec612f1 100644 (file)
@@ -153,4 +153,10 @@ else()
     if(esp32_test IN_LIST BUILD_TEST_COMPONENTS)
         add_definitions(-DESP_TIMER_DYNAMIC_OVERFLOW_VAL)
     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()