Merge branch 'bugfix/stack_check_error' into 'master'

esp_system: restore deleted no stack check flag

See merge request espressif/esp-idf!9721
This commit is contained in:
Angus Gratton 2020-07-28 07:43:41 +08:00
commit 9222f5473f
7 changed files with 14 additions and 16 deletions

View File

@ -75,12 +75,6 @@ else()
add_custom_target(esp32_linker_script DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/esp32_out.ld)
add_dependencies(${COMPONENT_LIB} esp32_linker_script)
# disable stack protection in files which are involved in initialization of that feature
set_source_files_properties(
cpu_start.c
PROPERTIES COMPILE_FLAGS
-fno-stack-protector)
if(CONFIG_SPIRAM_CACHE_WORKAROUND)
# Note: Adding as a PUBLIC compile option here causes this option to propagate to all components that depend on esp32.
#

View File

@ -40,5 +40,3 @@ esp32_out.ld: $(COMPONENT_PATH)/ld/esp32.ld ../include/sdkconfig.h
COMPONENT_EXTRA_CLEAN := esp32_out.ld $(COMPONENT_BUILD_DIR)/esp32.project.ld
# disable stack protection in files which are involved in initialization of that feature
cpu_start.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))

View File

@ -70,10 +70,4 @@ else()
add_custom_target(esp32s2_linker_script DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/esp32s2_out.ld)
add_dependencies(${COMPONENT_LIB} esp32s2_linker_script)
# disable stack protection in files which are involved in initialization of that feature
set_source_files_properties(
cpu_start.c
PROPERTIES COMPILE_FLAGS
-fno-stack-protector)
endif()

View File

@ -28,6 +28,7 @@ else()
"src/stack_check.c"
PROPERTIES COMPILE_FLAGS
-fno-stack-protector)
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_LIBRARIES "-Wl,--gc-sections")
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-Wl,--gc-sections")
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 4)

View File

@ -16,4 +16,10 @@ target_link_libraries(${COMPONENT_LIB} INTERFACE "-u start_app")
if (NOT CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u start_app_other_cores")
endif()
endif()
# Disable stack protection in files which are involved in initialization of that feature
set_source_files_properties(
startup.c
PROPERTIES COMPILE_FLAGS
-fno-stack-protector)

View File

@ -5,4 +5,7 @@ COMPONENT_ADD_INCLUDEDIRS := include
COMPONENT_PRIV_INCLUDEDIRS := private_include port/include
COMPONENT_ADD_LDFRAGMENTS += linker.lf
-include $(COMPONENT_PATH)/port/$(SOC_NAME)/component.mk
-include $(COMPONENT_PATH)/port/$(SOC_NAME)/component.mk
# disable stack protection in files which are involved in initialization of that feature
startup.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))

View File

@ -0,0 +1,2 @@
CONFIG_COMPILER_STACK_CHECK_MODE_ALL=y
CONFIG_COMPILER_STACK_CHECK=y