Merge branch 'bugfix/cxx_exception_pool_4.1' into 'release/v4.1'

startup: Make __cxx_eh_arena_size_get return 0 if exceptions disabled (v4.1)

See merge request espressif/esp-idf!19292
This commit is contained in:
David Čermák 2022-11-07 21:31:11 +08:00
commit d6f897956e
2 changed files with 20 additions and 4 deletions

View File

@ -523,12 +523,20 @@ void start_cpu1_default(void)
}
#endif //!CONFIG_FREERTOS_UNICORE
#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
/**
* This function overwrites a the same function of libsupc++ (part of libstdc++).
* Consequently, libsupc++ will then follow our configured exception emergency pool size.
*
* It will be called even with -fno-exception for user code since the stdlib still uses exceptions.
*/
size_t __cxx_eh_arena_size_get(void)
{
#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
return CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE;
}
#else
return 0;
#endif
}
static void do_global_ctors(void)
{

View File

@ -363,12 +363,20 @@ void start_cpu0_default(void)
abort(); /* Only get to here if not enough free heap to start scheduler */
}
#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
/**
* This function overwrites a the same function of libsupc++ (part of libstdc++).
* Consequently, libsupc++ will then follow our configured exception emergency pool size.
*
* It will be called even with -fno-exception for user code since the stdlib still uses exceptions.
*/
size_t __cxx_eh_arena_size_get(void)
{
#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
return CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE;
}
#else
return 0;
#endif
}
static void do_global_ctors(void)
{