Support: use internal `call_once` on PPC64le

Use the replacement execute once threading support in LLVM for PPC64le.  It
seems that GCC does not define `__ppc__` and so we would actually call out to
the C++ runtime there which is not what the current code intended.  Check both
`__ppc__` and `__PPC__`.  This avoids the need for checking the endianness.

Thanks to nemanjai for the hint about GCC's behaviour and the fact that the
reviewed condition could be simplified.

Original patch by Sarvesh Tamba!

llvm-svn: 348970
This commit is contained in:
Saleem Abdulrasool 2018-12-12 20:35:47 +00:00
parent 8c94f07f54
commit 9b5fce1ce9
1 changed files with 2 additions and 1 deletions

View File

@ -27,7 +27,8 @@
#define LLVM_THREADING_USE_STD_CALL_ONCE 1
#elif defined(LLVM_ON_UNIX) && \
(defined(_LIBCPP_VERSION) || \
!(defined(__NetBSD__) || defined(__OpenBSD__) || defined(__ppc__)))
!(defined(__NetBSD__) || defined(__OpenBSD__) || \
(defined(__ppc__) || defined(__PPC__))))
// std::call_once from libc++ is used on all Unix platforms. Other
// implementations like libstdc++ are known to have problems on NetBSD,
// OpenBSD and PowerPC.