Skip to content

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Jul 23, 2024

Fixes #80696

@ldionne ldionne added this to the LLVM 19.X Release milestone Jul 23, 2024
@ldionne ldionne requested a review from a team as a code owner July 23, 2024 16:40
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jul 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 23, 2024

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

Fixes #80696


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

2 Files Affected:

  • (modified) libcxx/CMakeLists.txt (+6-2)
  • (modified) libcxx/docs/BuildingLibcxx.rst (+2-1)
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 332816b15260a..674082c7d1787 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -71,12 +71,16 @@ if (NOT "${LIBCXX_HARDENING_MODE}" IN_LIST LIBCXX_SUPPORTED_HARDENING_MODES)
     "Unsupported hardening mode: '${LIBCXX_HARDENING_MODE}'. Supported values are ${LIBCXX_SUPPORTED_HARDENING_MODES}.")
 endif()
 set(LIBCXX_ASSERTION_HANDLER_FILE
-  "${CMAKE_CURRENT_SOURCE_DIR}/vendor/llvm/default_assertion_handler.in"
+  "vendor/llvm/default_assertion_handler.in"
   CACHE STRING
   "Specify the path to a header that contains a custom implementation of the
    assertion handler that gets invoked when a hardening assertion fails. If
    provided, this header will be included by the library, replacing the
-   default assertion handler.")
+   default assertion handler. If this is specified as a relative path, it
+   is assumed to be relative to '<monorepo>/libcxx'.")
+if (NOT IS_ABSOLUTE "${LIBCXX_ASSERTION_HANDLER_FILE}")
+  set(LIBCXX_ASSERTION_HANDLER_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${LIBCXX_ASSERTION_HANDLER_FILE}")
+endif()
 option(LIBCXX_ENABLE_RANDOM_DEVICE
   "Whether to include support for std::random_device in the library. Disabling
    this can be useful when building the library for platforms that don't have
diff --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst
index 66bb19bb5b2cd..5c224689e0f9f 100644
--- a/libcxx/docs/BuildingLibcxx.rst
+++ b/libcxx/docs/BuildingLibcxx.rst
@@ -406,7 +406,8 @@ libc++ Feature Options
   Specify the path to a header that contains a custom implementation of the
   assertion handler that gets invoked when a hardening assertion fails. If
   provided, this header will be included by the library, replacing the
-  default assertion handler.
+  default assertion handler. If this is specified as a relative path, it
+  is assumed to be relative to ``<monorepo>/libcxx``.
 
 
 libc++ ABI Feature Options

@ldionne ldionne merged commit 046a177 into llvm:main Jul 24, 2024
56 of 57 checks passed
@ldionne ldionne deleted the review/relative-assertion-handler-file branch July 24, 2024 16:03
@ldionne
Copy link
Member Author

ldionne commented Jul 24, 2024

/cherry-pick 046a177

llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Jul 24, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 24, 2024

/pull-request #100411

yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
…ON_HANDLER_FILE (#100157)

Summary: Fixes #80696

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60250671
tru pushed a commit to llvmbot/llvm-project that referenced this pull request Jul 26, 2024
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
Development

Successfully merging this pull request may close these issues.

[libc++] LIBCXX_ASSERTION_HANDLER_FILE needs to be relative from libcxx/include, which is strange
3 participants