[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:03:57 PDT 2023
mmuetzel updated this revision to Diff 553893.
mmuetzel added a comment.
Looking at the history of `libcxx/include/__verbose_abort` the macro `_LIBCPP_VERBOSE_ABORT` was introduced in the same changeset that made `std::__libcpp_verbose_abort` a weak symbol (from an inlined function).
That might be the point where that dependency of the FortranRuntime to libc++ first appeared.
Let's see if that pleases the CI.
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.553893.patch
Type: text/x-patch
Size: 580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230828/8e28a956/attachment-0001.bin>
More information about the flang-commits
mailing list