xref: /aosp_15_r20/external/perfetto/buildtools/libcxx_config/__config_site (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1// From chromium's buildtools/third_party/libc++/__config_site
2
3#ifndef _LIBCPP_CONFIG_SITE
4#define _LIBCPP_CONFIG_SITE
5
6// We set a custom _LIBCPP_ABI_NAMESPACE for the following reasons:
7//
8// 1. When libcxx_is_shared is true, symbols from libc++.so are exported for all
9//    DSOs to use.  If the system libc++ gets loaded (indirectly through a
10//    a system library), then it will conflict with our libc++.so.
11// 2. The default value of _LIBCPP_ABI_NAMESPACE is the string
12//    "_LIBCPP_ABI_NAMESPACE". This contributes to an increase in binary size;
13//    on Windows, the increase is great enough that we go above the 4GB size
14//    limit for PDBs (https://crbug.com/1327710#c5). To fix this, we set
15//    _LIBCPP_ABI_NAMESPACE to a shorter value.
16#define _LIBCPP_ABI_NAMESPACE __Cr
17
18#define _LIBCPP_ABI_VERSION 2
19
20/* #undef _LIBCPP_ABI_FORCE_ITANIUM */
21/* #undef _LIBCPP_ABI_FORCE_MICROSOFT */
22/* #undef _LIBCPP_HAS_NO_THREADS */
23/* #undef _LIBCPP_HAS_NO_MONOTONIC_CLOCK */
24/* #undef _LIBCPP_HAS_MUSL_LIBC */
25/* #undef _LIBCPP_HAS_THREAD_API_PTHREAD */
26/* #undef _LIBCPP_HAS_THREAD_API_EXTERNAL */
27/* #undef _LIBCPP_HAS_THREAD_API_WIN32 */
28/* #undef _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL */
29/* #undef _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS */
30#define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
31/* #undef _LIBCPP_NO_VCRUNTIME */
32/* #undef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION */
33/* #undef _LIBCPP_HAS_NO_FILESYSTEM */
34/* #undef _LIBCPP_HAS_PARALLEL_ALGORITHMS */
35/* #undef _LIBCPP_HAS_NO_RANDOM_DEVICE */
36/* #undef _LIBCPP_HAS_NO_LOCALIZATION */
37/* #undef _LIBCPP_HAS_NO_WIDE_CHARACTERS */
38
39// TODO(thakis): Is this right?
40/* #undef _LIBCPP_HAS_NO_STD_MODULES */
41
42// TODO(thakis): Is this right?
43/* #undef _LIBCPP_HAS_NO_TIME_ZONE_DATABASE */
44
45#define _LIBCPP_INSTRUMENTED_WITH_ASAN
46
47// PSTL backends
48/* #undef _LIBCPP_PSTL_BACKEND_SERIAL */
49#if defined(__APPLE__)
50#define _LIBCPP_PSTL_BACKEND_LIBDISPATCH
51#else
52#define _LIBCPP_PSTL_BACKEND_STD_THREAD
53#endif
54
55// PSTL backends, old spelling
56// TODO(thakis): Remove these after the next libc++ roll is in.
57/* #undef _LIBCPP_PSTL_CPU_BACKEND_SERIAL */
58#if defined(__APPLE__)
59#define _LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH
60#else
61#define _LIBCPP_PSTL_CPU_BACKEND_THREAD
62#endif
63
64// Settings below aren't part of __config_site upstream.
65// We set them here since we want them to take effect everywhere,
66// unconditionally.
67
68// Prevent libc++ from embedding linker flags to try to automatically link
69// against its runtime library. This is unnecessary with our build system,
70// and can also result in build failures if libc++'s name for a library
71// does not match ours.  Only has an effect on Windows.
72#define _LIBCPP_NO_AUTO_LINK
73
74#define _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
75
76// Don't add ABI tags to libc++ symbols. ABI tags increase mangled name sizes.
77// This only exists to allow multiple // libc++ versions to be linked into a
78// binary, which Chrome doesn't do.
79#define _LIBCPP_NO_ABI_TAG
80
81// Explicitly define  _LIBCPP_VERBOSE_ABORT(...) to call the termination
82// function because by default, this macro will does not call the verbose
83// termination function on Apple platforms.
84#define _LIBCPP_VERBOSE_ABORT(...) ::std::__libcpp_verbose_abort(__VA_ARGS__)
85
86// TODO(crbug.com/40272953) Link against compiler-rt's builtins library to
87// enable 128-arithmetic.
88#if defined(_WIN32)
89#define _LIBCPP_HAS_NO_INT128
90#endif
91
92// TODO(thakis): Remove this after LLVM 19's libc++ is rolled in.
93#define _LIBCPP_CHAR_TRAITS_REMOVE_BASE_SPECIALIZATION
94
95#define _LIBCPP_HARDENING_MODE_DEFAULT _LIBCPP_HARDENING_MODE_NONE
96
97// Enable libcxx part of compile-time thread safety analysis.
98#if defined(__clang__)
99#define _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS 1
100#endif
101
102#endif // _LIBCPP_CONFIG_SITE
103