Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Oct 2024 21:04:14 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a1269171d71f - stable/14 - libcxxrt: Add a stub implementation of __cxa_call_terminate
Message-ID:  <202410292104.49TL4EEQ078923@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=a1269171d71f6e03014f13ba52d4e86b6e8782a2

commit a1269171d71f6e03014f13ba52d4e86b6e8782a2
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-08-21 17:37:48 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-10-29 20:34:21 +0000

    libcxxrt: Add a stub implementation of __cxa_call_terminate
    
    This function is called by GCC 14 if a destructor invoked during
    exception unwinding throws an exception.
    
    Reviewed by:    emaste
    Obtained from:  libcxxrt commit 391a3dcc1054e18c2f0dff4e14d6d79ac95399d7
    Differential Revision:  https://reviews.freebsd.org/D46004
    
    (cherry picked from commit 297a9e552b9a5adf07d195eae9649b0758f395af)
---
 contrib/libcxxrt/exception.cc | 13 +++++++++++++
 lib/libcxxrt/Version.map      |  4 ++++
 2 files changed, 17 insertions(+)

diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc
index 35ff997dd445..b56333e979a2 100644
--- a/contrib/libcxxrt/exception.cc
+++ b/contrib/libcxxrt/exception.cc
@@ -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.
  */
diff --git a/lib/libcxxrt/Version.map b/lib/libcxxrt/Version.map
index a54b6a4daad5..39a54f4868a9 100644
--- a/lib/libcxxrt/Version.map
+++ b/lib/libcxxrt/Version.map
@@ -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++" {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202410292104.49TL4EEQ078923>