From f63bbc169e302d8a99cdac42a84bf2800c5e316a Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Wed, 2 Sep 2020 20:42:47 +0700 Subject: [PATCH] toolchain: fix the C++ exception workaround for new toolchains that don't have such hook --- components/esp_system/startup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/esp_system/startup.c b/components/esp_system/startup.c index 523136f257..d3cde8d927 100644 --- a/components/esp_system/startup.c +++ b/components/esp_system/startup.c @@ -108,9 +108,14 @@ sys_startup_fn_t g_startup_fn[1] = { start_cpu0 }; #ifdef CONFIG_COMPILER_CXX_EXCEPTIONS // workaround for C++ exception crashes -void _Unwind_SetNoFunctionContextInstall(unsigned char enable); +void _Unwind_SetNoFunctionContextInstall(unsigned char enable) __attribute__((weak, alias("_Unwind_SetNoFunctionContextInstall_Default"))); // workaround for C++ exception large memory allocation void _Unwind_SetEnableExceptionFdeSorting(unsigned char enable); + +static IRAM_ATTR void _Unwind_SetNoFunctionContextInstall_Default(unsigned char enable __attribute__((unused))) +{ + (void)0; +} #endif // CONFIG_COMPILER_CXX_EXCEPTIONS static const char* TAG = "cpu_start";