aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.7
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2013-04-18 10:46:17 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2013-04-19 13:52:43 +0800
commited7057a1ece24733fe30423cd94131deb8ccb2ca (patch)
tree7b5dc9bbb960650cb6204a815fc17161bcbb249b /gcc-4.7
parente90dcf26a383753557eced2a3323c2397627e595 (diff)
downloadtoolchain_gcc-ed7057a1ece24733fe30423cd94131deb8ccb2ca.tar.gz
toolchain_gcc-ed7057a1ece24733fe30423cd94131deb8ccb2ca.tar.bz2
toolchain_gcc-ed7057a1ece24733fe30423cd94131deb8ccb2ca.zip
Fix GNU4.7/4.8 libstdc++ for clang
Two fixes 1) Undefine GCC4.7/4.8 _GLIBCXX_ATOMIC_BUILTINS Clang arm/mips can't compile the following atomic intrinsics yet __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); Use library calls instead 2) Undefine GCC4.7/4.8 _GLIBCXX_USE_FLOAT128. Clang doesn't support __float128 yet Change-Id: I0ff0eb208665beeb3e5e09917fd4c7dd378fc54e
Diffstat (limited to 'gcc-4.7')
-rw-r--r--gcc-4.7/libstdc++-v3/include/ext/atomicity.h3
-rw-r--r--gcc-4.7/libstdc++-v3/include/std/type_traits2
2 files changed, 3 insertions, 2 deletions
diff --git a/gcc-4.7/libstdc++-v3/include/ext/atomicity.h b/gcc-4.7/libstdc++-v3/include/ext/atomicity.h
index c60306326..9f48b81c6 100644
--- a/gcc-4.7/libstdc++-v3/include/ext/atomicity.h
+++ b/gcc-4.7/libstdc++-v3/include/ext/atomicity.h
@@ -42,7 +42,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// To abstract locking primitives across all thread policies, use:
// __exchange_and_add_dispatch
// __atomic_add_dispatch
-#ifdef _GLIBCXX_ATOMIC_BUILTINS
+#if defined(_GLIBCXX_ATOMIC_BUILTINS) && (!defined(__clang__) || defined(__i386__))
+ // NOTE: clang arm/mips can't compile the following two library calls yet.
static inline _Atomic_word
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
diff --git a/gcc-4.7/libstdc++-v3/include/std/type_traits b/gcc-4.7/libstdc++-v3/include/std/type_traits
index 748469323..732f06a14 100644
--- a/gcc-4.7/libstdc++-v3/include/std/type_traits
+++ b/gcc-4.7/libstdc++-v3/include/std/type_traits
@@ -252,7 +252,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __is_floating_point_helper<long double>
: public true_type { };
-#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) && !defined(__clang__)
template<>
struct __is_floating_point_helper<__float128>
: public true_type { };