summaryrefslogtreecommitdiffstats
path: root/libcxx/include/__config
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-04-17 18:20:19 +0000
committerLouis Dionne <ldionne@apple.com>2019-04-17 18:20:19 +0000
commit81875a67b0d1bd43cca96b5e321a4af06b9299cd (patch)
treeef6b15900dc630a0ac388a3fb63f74a4dadfd61d /libcxx/include/__config
parent05a358cdcd55d1ee0a0d92383aa49489479c6362 (diff)
downloadbcm5719-llvm-81875a67b0d1bd43cca96b5e321a4af06b9299cd.tar.gz
bcm5719-llvm-81875a67b0d1bd43cca96b5e321a4af06b9299cd.zip
[libc++] Use the no_destroy attribute to avoid destroying debug DB statics
Summary: Otherwise, we can run into problems when the program has static variables that need to use the debug database during their deinitialization, if the debug DB has already been deinitialized. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D60830 llvm-svn: 358602
Diffstat (limited to 'libcxx/include/__config')
-rw-r--r--libcxx/include/__config6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index a7d0b141fa3..ead522520e8 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1120,6 +1120,12 @@ template <unsigned> struct __static_assert_check {};
#endif
#endif
+#if __has_attribute(no_destroy)
+# define _LIBCPP_NO_DESTROY __attribute__((__no_destroy__))
+#else
+# define _LIBCPP_NO_DESTROY
+#endif
+
#ifndef _LIBCPP_HAS_NO_ASAN
_LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
const void *, const void *, const void *, const void *);
OpenPOWER on IntegriCloud