forked from espressif/esp-idf
Merge branch 'feature/cxx_rtti_preparation_v3_v4.0' into 'release/v4.0'
C++: re-add provisions for optional RTTI support (backport v4.0) See merge request espressif/esp-idf!6557
This commit is contained in:
@@ -7,3 +7,7 @@ target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxa_guard_dummy")
|
|||||||
if(NOT CONFIG_COMPILER_CXX_EXCEPTIONS)
|
if(NOT CONFIG_COMPILER_CXX_EXCEPTIONS)
|
||||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxx_fatal_exception")
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxx_fatal_exception")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT CONFIG_COMPILER_CXX_RTTI)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} PUBLIC -fno-rtti)
|
||||||
|
endif()
|
||||||
|
@@ -56,11 +56,6 @@ else()
|
|||||||
target_linker_script(${COMPONENT_LIB} INTERFACE "ld/esp32.extram.bss.ld")
|
target_linker_script(${COMPONENT_LIB} INTERFACE "ld/esp32.extram.bss.ld")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CONFIG_COMPILER_CXX_RTTI)
|
|
||||||
# This has to be linked before esp32.project.ld
|
|
||||||
target_linker_script(${COMPONENT_LIB} INTERFACE "ld/esp32.discard-rtti.ld")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Process the template file through the linker script generation mechanism, and use the output for linking the
|
# Process the template file through the linker script generation mechanism, and use the output for linking the
|
||||||
# final binary
|
# final binary
|
||||||
target_linker_script(${COMPONENT_LIB} INTERFACE "${CMAKE_CURRENT_LIST_DIR}/ld/esp32.project.ld.in"
|
target_linker_script(${COMPONENT_LIB} INTERFACE "${CMAKE_CURRENT_LIST_DIR}/ld/esp32.project.ld.in"
|
||||||
|
@@ -5,23 +5,18 @@
|
|||||||
COMPONENT_SRCDIRS := .
|
COMPONENT_SRCDIRS := .
|
||||||
|
|
||||||
ifdef CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
|
ifdef CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
|
||||||
# This linker script must come before esp32.project.ld
|
# This linker script must come before esp32.project.ld
|
||||||
LINKER_SCRIPTS += esp32.extram.bss.ld
|
LINKER_SCRIPTS += esp32.extram.bss.ld
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef CONFIG_COMPILER_CXX_RTTI
|
#Linker scripts used to link the final application.
|
||||||
# This linker script must come before esp32.project.ld
|
#Warning: These linker scripts are only used when the normal app is compiled; the bootloader
|
||||||
LINKER_SCRIPTS += esp32.discard-rtti.ld
|
#specifies its own scripts.
|
||||||
endif
|
|
||||||
|
|
||||||
# Linker scripts used to link the final application.
|
|
||||||
# Warning: These linker scripts are only used when the normal app is compiled; the bootloader
|
|
||||||
# specifies its own scripts.
|
|
||||||
LINKER_SCRIPTS += $(COMPONENT_BUILD_DIR)/esp32.project.ld esp32.peripherals.ld
|
LINKER_SCRIPTS += $(COMPONENT_BUILD_DIR)/esp32.project.ld esp32.peripherals.ld
|
||||||
|
|
||||||
# ld_include_panic_highint_hdl is added as an undefined symbol because otherwise the
|
#ld_include_panic_highint_hdl is added as an undefined symbol because otherwise the
|
||||||
# linker will ignore panic_highint_hdl.S as it has no other files depending on any
|
#linker will ignore panic_highint_hdl.S as it has no other files depending on any
|
||||||
# symbols in it.
|
#symbols in it.
|
||||||
COMPONENT_ADD_LDFLAGS += -L $(COMPONENT_PATH)/ld \
|
COMPONENT_ADD_LDFLAGS += -L $(COMPONENT_PATH)/ld \
|
||||||
-T esp32_out.ld \
|
-T esp32_out.ld \
|
||||||
-u ld_include_panic_highint_hdl \
|
-u ld_include_panic_highint_hdl \
|
||||||
|
@@ -1,11 +0,0 @@
|
|||||||
/* This is only included if CONFIG_COMPILER_CXX_RTTI is not set, to
|
|
||||||
* move RTTI sections of libstdc++ to an unused non-loadable memory region.
|
|
||||||
*/
|
|
||||||
|
|
||||||
SECTIONS
|
|
||||||
{
|
|
||||||
.rodata.discard-rtti (NOLOAD):
|
|
||||||
{
|
|
||||||
*libstdc++.a:(.rodata._ZTI* .rodata._ZTS*)
|
|
||||||
} > discard_seg
|
|
||||||
}
|
|
@@ -86,11 +86,6 @@ MEMORY
|
|||||||
/* external memory ,including data and text */
|
/* external memory ,including data and text */
|
||||||
extern_ram_seg(RWX) : org = 0x3F800000,
|
extern_ram_seg(RWX) : org = 0x3F800000,
|
||||||
len = 0x400000
|
len = 0x400000
|
||||||
|
|
||||||
/* This is not a memory range which can really be accessed; we use it as a "bitbucket"
|
|
||||||
where non-loadable sections, which aren't used at run time, can be discarded.
|
|
||||||
*/
|
|
||||||
discard_seg (R) : org = 0x00000000, len = 0x10000000
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE)
|
#if defined(CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE)
|
||||||
|
@@ -468,6 +468,7 @@ ifdef CONFIG_COMPILER_CXX_RTTI
|
|||||||
CXXFLAGS += -frtti
|
CXXFLAGS += -frtti
|
||||||
else
|
else
|
||||||
CXXFLAGS += -fno-rtti
|
CXXFLAGS += -fno-rtti
|
||||||
|
LDFLAGS += -fno-rtti
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ARFLAGS := cru
|
ARFLAGS := cru
|
||||||
|
Reference in New Issue
Block a user