llvm-project/libcxx/cmake/caches
Louis Dionne b0fd9497af [libc++] Add a lightweight overridable assertion handler
This patch adds a lightweight assertion handler mechanism that can be
overriden at link-time in a fashion similar to `operator new`.

This is a third take on https://llvm.org/D121123 (which allowed customizing
the assertion handler at compile-time), and https://llvm.org/D119969
(which allowed customizing the assertion handler at runtime only).

This approach is, I think, the best of all three explored approaches.
Indeed, replacing the assertion handler in user code is ergonomic,
yet we retain the ability to provide a custom assertion handler when
deploying to older platforms that don't have a default handler in
the dylib.

As-is, this patch provides a pretty good amount of backwards compatibility
with the previous debug mode:

- Code that used to set _LIBCPP_DEBUG=0 in order to get basic assertions
  in their code will still get basic assertions out of the box, but
  those assertions will be using the new assertion handler support.
- Code that was previously compiled with references to __libcpp_debug_function
  and friends will work out-of-the-box, no changes required. This is
  because we provide the same symbols in the dylib as we used to.
- Code that used to set a custom __libcpp_debug_function will stop
  compiling, because we don't provide that declaration anymore. Users
  will have to migrate to the new way of setting a custom assertion
  handler, which is extremely easy. I suspect that pool of users is
  very limited, so breaking them at compile-time is probably acceptable.

The main downside of this approach is that code being compiled with
assertions enabled but deploying to an older platform where the assertion
handler didn't exist yet will fail to compile. However users can easily
fix the problem by providing a custom assertion handler and defining
the _LIBCPP_AVAILABILITY_CUSTOM_ASSERTION_HANDLER_PROVIDED macro to
let the library know about the custom handler. In a way, this is
actually a feature because it avoids a load-time error that one would
otherwise get when trying to run the code on the older target.

Differential Revision: https://reviews.llvm.org/D121478
2022-03-23 15:35:46 -04:00
..
AArch64.cmake [libcxx][ci] Switch to CMAKE_CXX_COMPILER_TARGET for Arm bots 2022-02-22 09:42:55 +00:00
AIX.cmake [libc++][AIX] Add scripts and config for building with the libcxx CI infrastructure 2021-10-14 14:31:10 -04:00
Apple.cmake [libc++] Refactor the Apple build scripts 2022-02-16 16:28:13 -05:00
Armv7Arm.cmake [libcxx][ci] Switch to CMAKE_CXX_COMPILER_TARGET for Arm bots 2022-02-22 09:42:55 +00:00
Armv7Thumb-noexceptions.cmake [libcxx][ci] Switch to CMAKE_CXX_COMPILER_TARGET for Arm bots 2022-02-22 09:42:55 +00:00
Armv8Arm.cmake [libcxx][ci] Switch to CMAKE_CXX_COMPILER_TARGET for Arm bots 2022-02-22 09:42:55 +00:00
Armv8Thumb-noexceptions.cmake [libcxx][ci] Switch to CMAKE_CXX_COMPILER_TARGET for Arm bots 2022-02-22 09:42:55 +00:00
FreeBSD.cmake Define new/delete in libc++ when using libcxxrt 2021-02-15 21:22:12 +01:00
Generic-abi-unstable.cmake [libc++] Add Unstable ABI CI run 2022-02-05 15:37:22 +01:00
Generic-asan.cmake [libc++][NFC] Work around false positive ODR violations from ASan. 2022-02-11 11:56:51 -08:00
Generic-assertions.cmake [libc++] Add a lightweight overridable assertion handler 2022-03-23 15:35:46 -04:00
Generic-cxx2b.cmake [libc++] Add basic support for -std=c++2b. 2021-01-08 19:02:41 +01:00
Generic-cxx03.cmake [runtimes] Allow passing Lit parameters through CMake 2020-07-09 12:45:00 -04:00
Generic-cxx11.cmake [runtimes] Allow passing Lit parameters through CMake 2020-07-09 12:45:00 -04:00
Generic-cxx14.cmake [runtimes] Allow passing Lit parameters through CMake 2020-07-09 12:45:00 -04:00
Generic-cxx17.cmake [runtimes] Allow passing Lit parameters through CMake 2020-07-09 12:45:00 -04:00
Generic-cxx20.cmake [libc++] Divorce the std Lit feature from the -std=XXX compiler flag 2021-04-12 11:55:39 -04:00
Generic-debug-iterators.cmake [libc++] Move LIBCXX-DEBUG-FIXME to params.py 2021-10-20 09:23:03 -04:00
Generic-modules.cmake [libc++] Add a CI configuration for the modular build 2021-06-08 13:32:08 -04:00
Generic-msan.cmake
Generic-no-debug.cmake [libc++] NFC: nodebug => no-debug in the CI configurations 2021-03-23 14:10:27 -04:00
Generic-no-experimental.cmake [libc++] Add CI without experimental features and don't exclude span from the tests 2022-02-02 10:48:35 -05:00
Generic-no-filesystem.cmake [libc++] Make LIBCXX_ENABLE_FILESYSTEM fully consistent 2021-01-19 14:15:48 -05:00
Generic-no-localization.cmake [libc++] Add a libc++ configuration that does not support localization 2020-10-27 14:56:30 -04:00
Generic-no-random_device.cmake [libc++] Allow building libc++ on platforms without a random device 2020-10-15 12:20:29 -04:00
Generic-no-unicode.cmake [libc++][format] Add a CMake Unicode option. 2021-09-04 11:55:10 +02:00
Generic-no-wide-characters.cmake [libc++] Add an option to disable wide character support in libc++ 2021-10-12 06:08:23 -04:00
Generic-noexceptions.cmake
Generic-singlethreaded.cmake
Generic-static.cmake [libc++] Switch a few CI jobs to the minimal Lit configuration 2021-05-20 10:46:59 -04:00
Generic-tsan.cmake
Generic-ubsan.cmake
MinGW.cmake [libcxx] Add LIBCXX_EXTRA_SITE_DEFINES for adding extra defines in __config_site 2021-12-22 00:43:29 +02:00
README.md

README.md

libc++ / libc++abi configuration caches

This directory contains CMake caches for the supported configurations of libc++. Some of the configurations are specific to a vendor, others are generic and not tied to any vendor.

While we won't explicitly work to break configurations not listed here, any configuration not listed here is not explicitly supported. If you use or ship libc++ under a configuration not listed here, you should work with the libc++ maintainers to make it into a supported configuration and add it here.

Similarly, adding any new configuration that's not already covered must be discussed with the libc++ maintainers as it entails a maintenance burden.