Skip to content

Conversation

@ldionne
Copy link
Member

@ldionne ldionne commented Jan 7, 2025

The documentation was misleading, suggesting that people could simply define these macros, when in reality they must be passed at CMake configuration time in a very specific way.

This was reported in #bitcoin/bitcoin#31612.

The documentation was misleading, suggesting that people could simply
define these macros, when in reality they must be passed at CMake
configuration time in a very specific way.

This was reported in #bitcoin/bitcoin#31612.
@ldionne ldionne requested a review from a team as a code owner January 7, 2025 14:48
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 7, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 7, 2025

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

The documentation was misleading, suggesting that people could simply define these macros, when in reality they must be passed at CMake configuration time in a very specific way.

This was reported in #bitcoin/bitcoin#31612.


Full diff: https://github.com/llvm/llvm-project/pull/121946.diff

1 Files Affected:

  • (modified) libcxx/docs/Hardening.rst (+4-1)
diff --git a/libcxx/docs/Hardening.rst b/libcxx/docs/Hardening.rst
index 531065afb8e82b..01236a356ae9e9 100644
--- a/libcxx/docs/Hardening.rst
+++ b/libcxx/docs/Hardening.rst
@@ -311,7 +311,10 @@ ABI configuration.
 ABI options
 -----------
 
-Vendors can use the following ABI options to enable additional hardening checks:
+Vendors can use some ABI options at CMake configuration time (when building libc++
+itself) to enable additional hardening checks. This is done by passing these
+macros as ``-DLIBCXX_ABI_DEFINES="_LIBCPP_ABI_FOO;_LIBCPP_ABI_BAR;etc"`` at
+CMake configuration time. The available options are:
 
 - ``_LIBCPP_ABI_BOUNDED_ITERATORS`` -- changes the iterator type of select
   containers (see below) to a bounded iterator that keeps track of whether it's

Copy link

@vasild vasild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 180dd2a

Following these instructions resolved the issue in bitcoin/bitcoin#31612

nit: while here maybe drop the extra trailing ` a bunch of lines below in:

``_LIBCPP_ABI_BOUNDED_UNIQUE_PTR```

@ldionne ldionne merged commit 1855333 into llvm:main Jan 7, 2025
38 of 41 checks passed
@ldionne ldionne deleted the review/fix-hardening-macro-documentation branch January 7, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants