fix(cxx): fix TLS classes destructor call

Closes https://github.com/espressif/esp-idf/issues/14360
This commit is contained in:
Alexey Lapshin
2024-08-23 16:57:42 +07:00
parent 564d777018
commit 2a02d45bde
3 changed files with 42 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -210,6 +210,12 @@ extern "C" void __cxa_guard_abort(__guard* pg) throw()
}
}
/* Originally, this should come with crtbegin.o from the toolchain (if GCC is configured with --enable-__cxa_atexit).
Since we do not link with crtbegin.o and have not configured GCC with --enable-__cxa_atexit, it is declared here.
Note: It should have a unique value in every shared object; in the main program its value is zero. */
extern "C" void *__dso_handle __attribute__((__visibility__("hidden")));
void *__dso_handle = 0;
/**
* Dummy function used to force linking this file instead of the same one in libstdc++.
* This works via -u __cxa_guard_dummy flag in component.mk