[llvm] [libcxx] [libc++][hardening] Rework macros for enabling the hardening mode. (PR #70575)
Louis Dionne via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 2 12:50:13 PDT 2023
================
@@ -55,19 +55,14 @@ Improvements and New Features
- ``std::ranges::count`` is now optimized for ``vector<bool>::iterator``, which
can lead up to 350x performance improvements.
-- The library now provides a hardened mode under which common cases of library undefined behavior will be turned into
- a reliable program termination. Vendors can configure whether the hardened mode is enabled by default with the
- ``LIBCXX_HARDENING_MODE`` variable at CMake configuration time. Users can control whether the hardened mode is
- enabled on a per translation unit basis using the ``-D_LIBCPP_ENABLE_HARDENED_MODE=1`` macro. See
- :ref:`the hardening documentation <using-hardening-modes>` for more details.
-
-- The library now provides a debug mode which is a superset of the safe mode, additionally enabling more expensive
- checks that are not suitable to be used in production. This replaces the legacy debug mode that was removed in this
- release. Unlike the legacy debug mode, this doesn't affect the ABI and doesn't require locking. Vendors can configure
- whether the debug mode is enabled by default with the ``LIBCXX_HARDENING_MODE`` variable at CMake configuration time.
- Users can control whether the debug mode is enabled on a per translation unit basis using the
- ``-D_LIBCPP_ENABLE_DEBUG_MODE=1`` macro. See :ref:`the hardening documentation <using-hardening-modes>` for more
- details.
+- The library now provides several hardening modes under which common cases of library undefined behavior will be turned
+ into a reliable program termination. The fast hardening mode enables a set of security-critical checks with minimal
----------------
ldionne wrote:
```suggestion
into a reliable program termination. The ``fast`` hardening mode enables a set of security-critical checks with minimal
```
Same for other modes?
https://github.com/llvm/llvm-project/pull/70575
More information about the llvm-commits
mailing list