From 80efa2f96ec311c1a0084a130658848bf86efd7c Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Wed, 6 Mar 2024 00:11:14 +0400 Subject: [PATCH] feat(cxx): get rid of _Unwind_SetEnableExceptionFdeSorting --- components/cxx/CMakeLists.txt | 1 - components/cxx/cxx_exception_stubs.cpp | 7 +------ components/esp_system/startup.c | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/components/cxx/CMakeLists.txt b/components/cxx/CMakeLists.txt index 88c439ffcf..f4f2a89a92 100644 --- a/components/cxx/CMakeLists.txt +++ b/components/cxx/CMakeLists.txt @@ -11,7 +11,6 @@ idf_component_register(SRCS "cxx_exception_stubs.cpp" if(NOT CONFIG_CXX_EXCEPTIONS) set(WRAP_FUNCTIONS - _Unwind_SetEnableExceptionFdeSorting __register_frame_info_bases __register_frame_info __register_frame diff --git a/components/cxx/cxx_exception_stubs.cpp b/components/cxx/cxx_exception_stubs.cpp index a89562756d..6310345716 100644 --- a/components/cxx/cxx_exception_stubs.cpp +++ b/components/cxx/cxx_exception_stubs.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -35,11 +35,6 @@ static T abort_return() } // unwind-dw2-fde.o -extern "C" void __wrap__Unwind_SetEnableExceptionFdeSorting(unsigned char enable) -{ - abort(); -} - extern "C" void __wrap___register_frame_info_bases (const void *begin, struct object *ob, void *tbase, void *dbase) { abort(); diff --git a/components/esp_system/startup.c b/components/esp_system/startup.c index f00c24da28..9d948512be 100644 --- a/components/esp_system/startup.c +++ b/components/esp_system/startup.c @@ -144,8 +144,6 @@ const 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) __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))) { @@ -542,7 +540,6 @@ ESP_SYSTEM_INIT_FN(init_components0, BIT(0), 200) #ifdef CONFIG_COMPILER_CXX_EXCEPTIONS ESP_EARLY_LOGD(TAG, "Setting C++ exception workarounds."); _Unwind_SetNoFunctionContextInstall(1); - _Unwind_SetEnableExceptionFdeSorting(0); #endif // CONFIG_COMPILER_CXX_EXCEPTIONS return ESP_OK;