diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-08-25 06:49:10 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-08-25 06:49:10 +0000 |
commit | 46c8c5540fe4995e01fcf2e173c05761e7ba9488 (patch) | |
tree | 6eafeb5c35272724a5c10d365a87384113eabcf6 /contrib/llvm-project/compiler-rt | |
parent | b3fc6d66120ca5d1aacf123a1fd2f099aa7bf1b5 (diff) | |
download | src-46c8c5540fe4995e01fcf2e173c05761e7ba9488.tar.gz src-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/compiler-rt')
-rw-r--r-- | contrib/llvm-project/compiler-rt/lib/builtins/atomic.c | 4 |
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 2a69101fbcee..84d116a36cd9 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) |