[libcxx-commits] [PATCH] D99913: [SystemZ][z/OS] Modify cxxabi to be compatible with existing z/OS runtime

Muiez Ahmed via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 2 13:32:19 PDT 2021


muiez updated this revision to Diff 384207.
muiez edited the summary of this revision.
muiez added a comment.

Use external unwind.h header.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99913/new/

https://reviews.llvm.org/D99913

Files:
  libcxxabi/src/CMakeLists.txt
  libcxxabi/src/cxa_exception.cpp
  libcxxabi/src/cxa_personality.cpp


Index: libcxxabi/src/cxa_personality.cpp
===================================================================
--- libcxxabi/src/cxa_personality.cpp
+++ libcxxabi/src/cxa_personality.cpp
@@ -613,7 +613,7 @@
         results.reason = _URC_FATAL_PHASE1_ERROR;
         return;
     }
-    // Start scan by getting exception table address
+    // Start scan by getting exception table address.
     const uint8_t *lsda = (const uint8_t *)_Unwind_GetLanguageSpecificData(context);
     if (lsda == 0)
     {
@@ -903,6 +903,8 @@
 _LIBCXXABI_FUNC_VIS _Unwind_Reason_Code
 #ifdef __USING_SJLJ_EXCEPTIONS__
 __gxx_personality_sj0
+#elif defined(__MVS__)
+__zos_cxx_personality_v2
 #else
 __gxx_personality_v0
 #endif
Index: libcxxabi/src/cxa_exception.cpp
===================================================================
--- libcxxabi/src/cxa_exception.cpp
+++ libcxxabi/src/cxa_exception.cpp
@@ -431,6 +431,11 @@
             (
                 static_cast<_Unwind_Exception*>(unwind_exception)
             );
+
+#if defined(__MVS__)
+    _UnwindZOS_PopException();
+#endif
+
     if (native_exception)
     {
         // Increment the handler count, removing the flag about being rethrown
Index: libcxxabi/src/CMakeLists.txt
===================================================================
--- libcxxabi/src/CMakeLists.txt
+++ libcxxabi/src/CMakeLists.txt
@@ -47,6 +47,13 @@
   ../include/cxxabi.h
 )
 
+if (ZOS)
+  list(APPEND LIBCXXABI_HEADERS
+    ${LLVM_EXTERNAL_UNWIND_SOURCE_DIR}/unwind.h
+  )
+  include_directories("${LLVM_EXTERNAL_UNWIND_SOURCE_DIR}")
+endif()
+
 # Add all the headers to the project for IDEs.
 if (MSVC_IDE OR XCODE)
   # Force them all into the headers dir on MSVC, otherwise they end up at


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99913.384207.patch
Type: text/x-patch
Size: 1718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211102/b15b4ee5/attachment.bin>


More information about the libcxx-commits mailing list