From c6ece6bf3b079965d041de41d928fb46cf36faad Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 5 Jun 2016 02:46:01 +0000 Subject: [PATCH] Disable the use of std::call_once on PowerPC due to an apparent bug in libstdc++ (or in compilers, or somewhere, I can't track it down) that causes unittests that use INITIALIZE_PASS to crash. The analysis I've been able to do is that inside libstdc++'s implementation of std::call_once, it uses pthread_once, and when that returns an error code it throws std::system_error which then eventually calls std::terminate. Hopefully some of the folks who work on PPC can try to sort out what's going on here. Until then, they'll have to use the fallback implementation. llvm-svn: 271821 --- include/llvm/Support/Threading.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/llvm/Support/Threading.h b/include/llvm/Support/Threading.h index 387bf5e1b94..09b96dfb4c1 100644 --- a/include/llvm/Support/Threading.h +++ b/include/llvm/Support/Threading.h @@ -23,7 +23,8 @@ // We use std::call_once on all Unix platforms except for NetBSD with // libstdc++. That platform has a bug they are working to fix, and they'll // remove the NetBSD checks once fixed. -#if defined(LLVM_ON_UNIX) && !(defined(__NetBSD__) && !defined(_LIBCPP_VERSION)) +#if defined(LLVM_ON_UNIX) && \ + !(defined(__NetBSD__) && !defined(_LIBCPP_VERSION)) && !defined(__ppc__) #define LLVM_THREADING_USE_STD_CALL_ONCE 1 #else #define LLVM_THREADING_USE_STD_CALL_ONCE 0