mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(cxx): use __cxa_throw() stub in case exceptions disabled
Reduces binary size since the linker will drop some code due to --gc-sections.
This commit is contained in:
parent
9375348740
commit
afffbd9dd0
@ -39,7 +39,9 @@ if(NOT CONFIG_CXX_EXCEPTIONS)
|
|||||||
_Unwind_Resume_or_Rethrow
|
_Unwind_Resume_or_Rethrow
|
||||||
_Unwind_Backtrace
|
_Unwind_Backtrace
|
||||||
__cxa_call_unexpected
|
__cxa_call_unexpected
|
||||||
__gxx_personality_v0)
|
__gxx_personality_v0
|
||||||
|
__cxa_throw
|
||||||
|
__cxa_allocate_exception)
|
||||||
|
|
||||||
foreach(wrap ${WRAP_FUNCTIONS})
|
foreach(wrap ${WRAP_FUNCTIONS})
|
||||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${wrap}")
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${wrap}")
|
||||||
|
@ -178,4 +178,16 @@ extern "C" _Unwind_Reason_Code __wrap___gxx_personality_v0(int version,
|
|||||||
return abort_return<_Unwind_Reason_Code>();
|
return abort_return<_Unwind_Reason_Code>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reduces binary size since the linker will drop some code due to --gc-sections.
|
||||||
|
extern "C" void __wrap___cxa_allocate_exception(void)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reduces binary size since the linker will drop some code due to --gc-sections.
|
||||||
|
extern "C" void __wrap___cxa_throw(void)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
#endif // CONFIG_COMPILER_CXX_EXCEPTIONS
|
#endif // CONFIG_COMPILER_CXX_EXCEPTIONS
|
||||||
|
Loading…
Reference in New Issue
Block a user