summaryrefslogtreecommitdiff
path: root/contrib/llvm-project
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-08-25 06:49:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-08-25 06:49:10 +0000
commit46c8c5540fe4995e01fcf2e173c05761e7ba9488 (patch)
tree6eafeb5c35272724a5c10d365a87384113eabcf6 /contrib/llvm-project
parentb3fc6d66120ca5d1aacf123a1fd2f099aa7bf1b5 (diff)
downloadsrc-test-46c8c5540fe4995e01fcf2e173c05761e7ba9488.tar.gz
src-test-46c8c5540fe4995e01fcf2e173c05761e7ba9488.zip
Add atomic and bswap functions to libcompiler_rt
There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26159
Notes
Notes: svn path=/head/; revision=364753
Diffstat (limited to 'contrib/llvm-project')
-rw-r--r--contrib/llvm-project/compiler-rt/lib/builtins/atomic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c b/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
index 2a69101fbceed..84d116a36cd9d 100644
--- a/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
+++ b/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
@@ -125,8 +125,8 @@ static __inline Lock *lock_for_pointer(void *ptr) {
#define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2)
#define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4)
-/// 32 bit PowerPC doesn't support 8-byte lock_free atomics
-#if !defined(__powerpc64__) && defined(__powerpc__)
+/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics
+#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__))
#define IS_LOCK_FREE_8 0
#else
#define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8)