The debug mode has been broken pretty much ever since it was shipped because it was possible to enable the debug mode in user code without actually enabling it in the dylib, leading to ODR violations that caused various kinds of failures. This commit makes the debug mode a knob that is configured when building the library and which can't be changed afterwards. This is less flexible for users, however it will actually work as intended and it will allow us, in the future, to add various kinds of checks that do not assume the same ABI as the normal library. Furthermore, this will make the debug mode more robust, which means that vendors might be more tempted to support it properly, which hasn't been the case with the current debug mode. This patch shouldn't break any user code, except folks who are building against a library that doesn't have the debug mode enabled and who try to enable the debug mode in their code. Such users will get a compile-time error explaining that this configuration isn't supported anymore. In the future, we should further increase the granularity of the debug mode checks so that we can cherry-pick which checks to enable, like we do for unspecified behavior randomization. Differential Revision: https://reviews.llvm.org/D122941
52 lines
1.9 KiB
Plaintext
52 lines
1.9 KiB
Plaintext
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef _LIBCPP___CONFIG_SITE
|
|
#define _LIBCPP___CONFIG_SITE
|
|
|
|
#cmakedefine _LIBCPP_ABI_VERSION @_LIBCPP_ABI_VERSION@
|
|
#cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@
|
|
#cmakedefine _LIBCPP_ABI_FORCE_ITANIUM
|
|
#cmakedefine _LIBCPP_ABI_FORCE_MICROSOFT
|
|
#cmakedefine _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
|
|
#cmakedefine _LIBCPP_HAS_NO_THREADS
|
|
#cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK
|
|
#cmakedefine _LIBCPP_HAS_MUSL_LIBC
|
|
#cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD
|
|
#cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL
|
|
#cmakedefine _LIBCPP_HAS_THREAD_API_WIN32
|
|
#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL
|
|
#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
|
|
#cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
|
|
#cmakedefine _LIBCPP_NO_VCRUNTIME
|
|
#cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@
|
|
#cmakedefine _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
|
|
#cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS
|
|
#cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE
|
|
#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION
|
|
#cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
|
#cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_FORMAT
|
|
#cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_RANGES
|
|
#cmakedefine01 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT
|
|
#cmakedefine _LIBCPP_ENABLE_DEBUG_MODE
|
|
|
|
// __USE_MINGW_ANSI_STDIO gets redefined on MinGW
|
|
#ifdef __clang__
|
|
# pragma clang diagnostic push
|
|
# pragma clang diagnostic ignored "-Wmacro-redefined"
|
|
#endif
|
|
|
|
@_LIBCPP_ABI_DEFINES@
|
|
@_LIBCPP_EXTRA_SITE_DEFINES@
|
|
|
|
#ifdef __clang__
|
|
# pragma clang diagnostic pop
|
|
#endif
|
|
|
|
#endif // _LIBCPP___CONFIG_SITE
|