[flang-commits] [PATCH] D158957: [flang][runtime] Avoid dependency on libc++ for `std::__libcpp_verbose_abort`

Markus Mützel via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Aug 28 05:21:34 PDT 2023


mmuetzel updated this revision to Diff 553899.
mmuetzel added a comment.

Seems to have worked.

Now with clang-format.


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

https://reviews.llvm.org/D158957

Files:
  flang/runtime/io-api.cpp


Index: flang/runtime/io-api.cpp
===================================================================
--- flang/runtime/io-api.cpp
+++ flang/runtime/io-api.cpp
@@ -1515,3 +1515,17 @@
 #endif
 
 } // namespace Fortran::runtime::io
+
+#if defined(_LIBCPP_VERBOSE_ABORT)
+// Provide own definition for `std::__libcpp_verbose_abort` to avoid dependency
+// on the version provided by libc++.
+
+void std::__libcpp_verbose_abort(char const *format, ...) {
+  va_list list;
+  va_start(list, format);
+  std::vfprintf(stderr, format, list);
+  va_end(list);
+
+  std::abort();
+}
+#endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158957.553899.patch
Type: text/x-patch
Size: 580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230828/bb94fd9f/attachment.bin>


More information about the flang-commits mailing list