Skip to content

Commit 9222f54

Browse files
committed
Merge branch 'bugfix/stack_check_error' into 'master'
esp_system: restore deleted no stack check flag See merge request espressif/esp-idf!9721
2 parents 2f74b4e + 837052c commit 9222f54

File tree

7 files changed

+14
-16
lines changed

7 files changed

+14
-16
lines changed

components/esp32/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ else()
7575
add_custom_target(esp32_linker_script DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/esp32_out.ld)
7676
add_dependencies(${COMPONENT_LIB} esp32_linker_script)
7777

78-
# disable stack protection in files which are involved in initialization of that feature
79-
set_source_files_properties(
80-
cpu_start.c
81-
PROPERTIES COMPILE_FLAGS
82-
-fno-stack-protector)
83-
8478
if(CONFIG_SPIRAM_CACHE_WORKAROUND)
8579
# Note: Adding as a PUBLIC compile option here causes this option to propagate to all components that depend on esp32.
8680
#

components/esp32/component.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ esp32_out.ld: $(COMPONENT_PATH)/ld/esp32.ld ../include/sdkconfig.h
4040

4141
COMPONENT_EXTRA_CLEAN := esp32_out.ld $(COMPONENT_BUILD_DIR)/esp32.project.ld
4242

43-
# disable stack protection in files which are involved in initialization of that feature
44-
cpu_start.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))

components/esp32s2/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,4 @@ else()
7070

7171
add_custom_target(esp32s2_linker_script DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/esp32s2_out.ld)
7272
add_dependencies(${COMPONENT_LIB} esp32s2_linker_script)
73-
74-
# disable stack protection in files which are involved in initialization of that feature
75-
set_source_files_properties(
76-
cpu_start.c
77-
PROPERTIES COMPILE_FLAGS
78-
-fno-stack-protector)
7973
endif()

components/esp_common/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ else()
2828
"src/stack_check.c"
2929
PROPERTIES COMPILE_FLAGS
3030
-fno-stack-protector)
31+
3132
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_LIBRARIES "-Wl,--gc-sections")
3233
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-Wl,--gc-sections")
3334
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 4)

components/esp_system/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ target_link_libraries(${COMPONENT_LIB} INTERFACE "-u start_app")
1616

1717
if (NOT CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE)
1818
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u start_app_other_cores")
19-
endif()
19+
endif()
20+
21+
# Disable stack protection in files which are involved in initialization of that feature
22+
set_source_files_properties(
23+
startup.c
24+
PROPERTIES COMPILE_FLAGS
25+
-fno-stack-protector)

components/esp_system/component.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ COMPONENT_ADD_INCLUDEDIRS := include
55
COMPONENT_PRIV_INCLUDEDIRS := private_include port/include
66
COMPONENT_ADD_LDFRAGMENTS += linker.lf
77

8-
-include $(COMPONENT_PATH)/port/$(SOC_NAME)/component.mk
8+
-include $(COMPONENT_PATH)/port/$(SOC_NAME)/component.mk
9+
10+
# disable stack protection in files which are involved in initialization of that feature
11+
startup.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_COMPILER_STACK_CHECK_MODE_ALL=y
2+
CONFIG_COMPILER_STACK_CHECK=y

0 commit comments

Comments
 (0)