aboutsummaryrefslogtreecommitdiff
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
parentb3fc6d66120ca5d1aacf123a1fd2f099aa7bf1b5 (diff)
Notes
-rw-r--r--contrib/llvm-project/compiler-rt/lib/builtins/atomic.c4
-rw-r--r--lib/libcompiler_rt/Makefile.inc23
-rw-r--r--sys/sys/param.h2
3 files changed, 12 insertions, 17 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)
diff --git a/lib/libcompiler_rt/Makefile.inc b/lib/libcompiler_rt/Makefile.inc
index 338f36571f65..ef00f8a5649d 100644
--- a/lib/libcompiler_rt/Makefile.inc
+++ b/lib/libcompiler_rt/Makefile.inc
@@ -1,5 +1,7 @@
# $FreeBSD$
+.include <bsd.compiler.mk>
+
CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/}
CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins
@@ -18,6 +20,9 @@ SRCF+= ashldi3
SRCF+= ashlti3
SRCF+= ashrdi3
SRCF+= ashrti3
+SRCF+= atomic
+SRCF+= bswapdi2
+SRCF+= bswapsi2
SRCF+= clear_cache
SRCF+= clzdi2
SRCF+= clzsi2
@@ -120,6 +125,10 @@ SRCF+= umoddi3
SRCF+= umodsi3
SRCF+= umodti3
+.if "${COMPILER_TYPE}" == "clang"
+CFLAGS.atomic.c+= -Wno-atomic-alignment
+.endif
+
# Avoid using SSE2 instructions on i386, if unsupported.
.if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)
SRCS+= floatdidf.c
@@ -212,12 +221,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS
SRCF+= stdatomic
.endif
-.if "${COMPILER_TYPE}" == "clang" && \
- (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe")
-SRCS+= atomic.c
-CFLAGS.atomic.c+= -Wno-atomic-alignment
-.endif
-
.for file in ${SRCF}
.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \
&& exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
@@ -239,8 +242,6 @@ SRCS+= aeabi_memmove.S
SRCS+= aeabi_memset.S
SRCS+= aeabi_uidivmod.S
SRCS+= aeabi_uldivmod.S
-SRCS+= bswapdi2.S
-SRCS+= bswapsi2.S
SRCS+= switch16.S
SRCS+= switch32.S
SRCS+= switch8.S
@@ -248,12 +249,6 @@ SRCS+= switchu8.S
SRCS+= sync_synchronize.S
.endif
-# On some archs GCC-6.3 requires bswap32 built-in.
-.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv"
-SRCS+= bswapdi2.c
-SRCS+= bswapsi2.c
-.endif
-
.if ${MACHINE_ARCH:Mriscv*sf}
CFLAGS+= -D__SOFT_FP__
.endif
diff --git a/sys/sys/param.h b/sys/sys/param.h
index db6520c42aa9..e9b96577bc34 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -60,7 +60,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1300112 /* Master, propagated to newvers */
+#define __FreeBSD_version 1300113 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,