Skip to content

Commit

Permalink
libcxxrt: Add a stub implementation of __cxa_call_terminate
Browse files Browse the repository at this point in the history
This function is called by GCC 14 if a destructor invoked during
exception unwinding throws an exception.

Obtained from FreeBSD 13 stable 6b5a9d287d03fde3801afa9809b0a9640ec6bf89
  • Loading branch information
laffer1 committed Dec 1, 2024
1 parent 9eefb20 commit edec20d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions contrib/libcxxrt/exception.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,19 @@ extern "C" void __cxa_call_unexpected(void*exception)
abort();
}

/**
* ABI function, called when an object destructor exits due to an
* exception during stack unwinding.
*
* This function does not return.
*/
extern "C" void __cxa_call_terminate(void *exception) throw()
{
std::terminate();
// Should not be reached.
abort();
}

/**
* ABI function, returns the adjusted pointer to the exception object.
*/
Expand Down
4 changes: 4 additions & 0 deletions lib/libcxxrt/Version.map
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ CXXABI_1.3.11 {
__cxa_init_primary_exception;
} CXXABI_1.3.9;

CXXABI_1.3.15 {
__cxa_call_terminate;
} CXXABI_1.3.11;

CXXRT_1.0 {

extern "C++" {
Expand Down

0 comments on commit edec20d

Please sign in to comment.