svn commit: r288121 - projects/clang370-import/contrib/libc++/src/support

Dimitry Andric dim at FreeBSD.org
Tue Sep 22 17:34:52 UTC 2015


Author: dim
Date: Tue Sep 22 17:34:51 2015
New Revision: 288121
URL: https://svnweb.freebsd.org/changeset/base/288121

Log:
  Work around clang emitting libcalls to __atomic_add_fetch() and friends
  in libc++, on __ARM_ARCH < 6.  Additionally, supply the missing stub
  __libcpp_relaxed_store(), as proposed in http://reviews.llvm.org/D13051
  
  NOTE: this needs to be fixed properly later on, by supplying library
  functions implementing atomic operations for arm < v6.  We should
  probably take those from sys/arm/arm/stdatomic.c, and stuff them into
  either libgcc or compiler-rt.

Modified:
  projects/clang370-import/contrib/libc++/src/support/atomic_support.h

Modified: projects/clang370-import/contrib/libc++/src/support/atomic_support.h
==============================================================================
--- projects/clang370-import/contrib/libc++/src/support/atomic_support.h	Tue Sep 22 16:59:41 2015	(r288120)
+++ projects/clang370-import/contrib/libc++/src/support/atomic_support.h	Tue Sep 22 17:34:51 2015	(r288121)
@@ -13,7 +13,8 @@
                        && defined(__ATOMIC_ACQUIRE)                  \
                        && defined(__ATOMIC_RELEASE)                  \
                        && defined(__ATOMIC_ACQ_REL)                  \
-                       && defined(__ATOMIC_SEQ_CST)
+                       && defined(__ATOMIC_SEQ_CST)                  \
+                       && defined(__ARM_ARCH) && __ARM_ARCH >= 6
 #   define _LIBCPP_HAS_ATOMIC_BUILTINS
 #elif !defined(__clang__) && defined(_GNUC_VER) && _GNUC_VER >= 407
 #   define _LIBCPP_HAS_ATOMIC_BUILTINS
@@ -103,6 +104,13 @@ void __libcpp_atomic_store(_ValueType* _
     *__dest = __val;
 }
 
+template <class _ValueType, class _FromType>
+inline _LIBCPP_INLINE_VISIBILITY
+void __libcpp_relaxed_store(_ValueType* __dest, _FromType __val)
+{
+    *__dest = __val;
+}
+
 template <class _ValueType>
 inline _LIBCPP_INLINE_VISIBILITY
 _ValueType __libcpp_atomic_load(_ValueType const* __val,


More information about the svn-src-projects mailing list