[libcxx-commits] [libcxx] [libcxxabi] [libc++][hardening] Implement support for assertion semantics. (PR #148172)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 11 10:02:32 PDT 2025


================
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <__config>
+#include <__log_hardening_failure>
+#include <cstdio>
+
+#ifdef __BIONIC__
+#  include <syslog.h>
+extern "C" void android_set_abort_message(const char* msg);
+#endif // __BIONIC__
+
+#if defined(__APPLE__) && __has_include(<os/reason_private.h>)
+#  include <os/reason_private.h>
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_WEAK void __libcpp_log_hardening_failure(const char* message) noexcept {
----------------
ldionne wrote:

```suggestion
void __libcpp_log_hardening_failure(const char* message) noexcept {
```

https://github.com/llvm/llvm-project/pull/148172


More information about the libcxx-commits mailing list