toolchain: C++ exception workaround

* disable C++ exception FDE sorting (saves RAM)

Closes IDF-1128
This commit is contained in:
Jakob Hasse
2020-04-24 15:41:08 +08:00
committed by Anton Maklakov
parent 1797fa7716
commit 8329d51fd0
2 changed files with 155 additions and 14 deletions

View File

@@ -108,6 +108,11 @@ struct object { long placeholder[ 10 ]; };
void __register_frame_info (const void *begin, struct object *ob);
extern char __eh_frame[];
#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
// workaround for C++ exception large memory allocation
void _Unwind_SetEnableExceptionFdeSorting(unsigned char enable);
#endif // CONFIG_COMPILER_CXX_EXCEPTIONS
//If CONFIG_SPIRAM_IGNORE_NOTFOUND is set and external RAM is not found or errors out on testing, this is set to false.
static bool s_spiram_okay=true;
@@ -382,6 +387,12 @@ void start_cpu0_default(void)
assert(err == ESP_OK && "Failed to init pthread module!");
do_global_ctors();
#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
ESP_EARLY_LOGD(TAG, "Setting C++ exception workarounds.");
_Unwind_SetEnableExceptionFdeSorting(0);
#endif // CONFIG_COMPILER_CXX_EXCEPTIONS
#if CONFIG_ESP_INT_WDT
esp_int_wdt_init();
//Initialize the interrupt watch dog for CPU0.