[PATCH] D53631: Fix libcxx build with MinGW winpthreads

Eric Fiselier via Phabricator reviews at reviews.llvm.org
Wed Oct 24 15:29:47 PDT 2018


EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.

> _LIBCPP_SAFE_STATIC incompatible with winpthreads, because winpthread PTHREAD_*_INITIALIZER use reinterpret_cast are not const.

winpthread PTHREAD_*_INITIALIZER is incompatible with the POSIX specification for PTHREAD_*_INITIALIZER. If we need to work around that, then fine, but it causes mutex to become really dangerous.

this is a bug in winpthreads and they should fix it.



================
Comment at: include/__config:1228
 
-#if __has_attribute(require_constant_initialization)
+#if __has_attribute(require_constant_initialization) &&                        \
+    !(defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && defined(__MINGW32__))
----------------
mclow.lists wrote:
> I think you want to look at line #1155, and see if `_LIBCPP_HAS_THREAD_API_WIN32` is the condition you want here.
> 
This change is *not* OK.

You want to disable the application of this macro only in the specific case that's giving you problems, not generally.


Repository:
  rCXX libc++

https://reviews.llvm.org/D53631





More information about the libcxx-commits mailing list