Page MenuHomeFreeBSD

D22549.diff
No OneTemporary

D22549.diff

Index: head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp
===================================================================
--- head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp
+++ head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp
@@ -9896,6 +9896,13 @@
}
}
+ // Avoid emiting call for runtime decision on PowerPC 32-bit
+ // The lock free possibilities on this platform are covered by the lines
+ // above and we know in advance other cases require lock
+ if (Info.Ctx.getTargetInfo().getTriple().getArch() == llvm::Triple::ppc) {
+ return Success(0, E);
+ }
+
return BuiltinOp == Builtin::BI__atomic_always_lock_free ?
Success(0, E) : Error(E);
}
Index: head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
===================================================================
--- head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
+++ head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
@@ -51,8 +51,8 @@
////////////////////////////////////////////////////////////////////////////////
#ifdef __FreeBSD__
#include <errno.h>
-#include <machine/atomic.h>
#include <sys/types.h>
+#include <machine/atomic.h>
#include <sys/umtx.h>
typedef struct _usem Lock;
__inline static void unlock(Lock *l) {
@@ -117,13 +117,20 @@
return locks + (hash & SPINLOCK_MASK);
}
-/// Macros for determining whether a size is lock free. Clang can not yet
-/// codegen __atomic_is_lock_free(16), so for now we assume 16-byte values are
-/// not lock free.
+/// Macros for determining whether a size is lock free.
#define IS_LOCK_FREE_1 __c11_atomic_is_lock_free(1)
#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__)
+#define IS_LOCK_FREE_8 0
+#else
#define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8)
+#endif
+
+/// Clang can not yet codegen __atomic_is_lock_free(16), so for now we assume
+/// 16-byte values are not lock free.
#define IS_LOCK_FREE_16 0
/// Macro that calls the compiler-generated lock-free versions of functions
Index: head/lib/libcompiler_rt/Makefile.inc
===================================================================
--- head/lib/libcompiler_rt/Makefile.inc
+++ head/lib/libcompiler_rt/Makefile.inc
@@ -205,6 +205,14 @@
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)

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 4, 4:30 AM (22 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13512483
Default Alt Text
D22549.diff (2 KB)

Event Timeline