[llvm] r271821 - Disable the use of std::call_once on PowerPC due to an apparent bug in

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 4 19:46:03 PDT 2016


Author: chandlerc
Date: Sat Jun  4 21:46:01 2016
New Revision: 271821

URL: http://llvm.org/viewvc/llvm-project?rev=271821&view=rev
Log:
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.

Modified:
    llvm/trunk/include/llvm/Support/Threading.h

Modified: llvm/trunk/include/llvm/Support/Threading.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Threading.h?rev=271821&r1=271820&r2=271821&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Threading.h (original)
+++ llvm/trunk/include/llvm/Support/Threading.h Sat Jun  4 21:46:01 2016
@@ -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




More information about the llvm-commits mailing list