summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-03-15 12:16:47 -0700
committerKhem Raj <raj.khem@gmail.com>2016-03-15 19:44:53 +0000
commit4e430cc7b14c2e52071c03b796b1b7a017b4790f (patch)
treeee14c3c4162d248ec505bdc52d94e40f827f87b6 /recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch
parent6b15e67b863e024b1eb20b93f48fd66aec538056 (diff)
downloadmeta-clang-4e430cc7b14c2e52071c03b796b1b7a017b4790f.tar.gz
libcxx,libcxxabi: Use cmake knobs for musl
libcxx already has support for musl, enable that instead of patching code Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch')
-rw-r--r--recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch b/recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch
new file mode 100644
index 0000000..f66de8f
--- /dev/null
+++ b/recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch
@@ -0,0 +1,56 @@
1From 21ddd574f6e9b321614d39a7765f1ad98aa09f54 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 15 Mar 2016 04:56:27 +0000
4Subject: [PATCH] use constexpr when using glibc
5
6POSIX does not permit using PTHREAD_COND_INITIALIZER except for static
7initialization, and certainly does not permit using it as a value
8
9also POSIX does not specify the type of the object (it's opaque) so if
10there are any types for which their code would be invalid C++, then their
11code is invalid
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 include/__mutex_base | 11 ++++++++---
16 1 file changed, 8 insertions(+), 3 deletions(-)
17
18diff --git a/include/__mutex_base b/include/__mutex_base
19index b019b47..10ad9f2 100644
20--- a/include/__mutex_base
21+++ b/include/__mutex_base
22@@ -33,7 +33,10 @@ class _LIBCPP_TYPE_VIS mutex
23 public:
24 _LIBCPP_INLINE_VISIBILITY
25 #ifndef _LIBCPP_HAS_NO_CONSTEXPR
26- constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
27+#ifdef __GLIBC__
28+ constexpr
29+#endif
30+ mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
31 #else
32 mutex() _NOEXCEPT {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;}
33 #endif
34@@ -63,7 +66,6 @@ extern const try_to_lock_t try_to_lock;
35 extern const adopt_lock_t adopt_lock;
36
37 #else
38-
39 constexpr defer_lock_t defer_lock = defer_lock_t();
40 constexpr try_to_lock_t try_to_lock = try_to_lock_t();
41 constexpr adopt_lock_t adopt_lock = adopt_lock_t();
42@@ -272,7 +274,10 @@ class _LIBCPP_TYPE_VIS condition_variable
43 public:
44 _LIBCPP_INLINE_VISIBILITY
45 #ifndef _LIBCPP_HAS_NO_CONSTEXPR
46- constexpr condition_variable() : __cv_(PTHREAD_COND_INITIALIZER) {}
47+#ifdef __GLIBC__
48+ constexpr
49+#endif
50+ condition_variable() : __cv_(PTHREAD_COND_INITIALIZER) {}
51 #else
52 condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;}
53 #endif
54--
551.9.1
56