[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 12:23:26 PDT 2025


================
@@ -19,6 +19,11 @@
 #include "../abort_message.h"
 #endif
 
+#ifndef _LIBCPP_LOG_HARDENING_FAILURE
----------------
ldionne wrote:

The only purpose of these defines is to work around the messed up layering of libc++ and libc++abi. However, in practice, the demangler is never going to be built with Observe mode, so the code added in libc++abi is never really going to be used. Instead, I would suggest not adding any new function to libc++abi and doing this instead:

```
#ifndef _LIBCPP_LOG_HARDENING_FAILURE
// Libc++abi does not have any functionality to log and continue, so we drop error messages when
// we build the demangler with observe mode. Once the layering with libc++ is improved, this could
// use the libc++ functionality to log hardening failures.
#define _LIBCPP_LOG_HARDENING_FAILURE(message) // nothing
#endif
```

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


More information about the libcxx-commits mailing list