[LLVMdev] Cygwin bootstrap is incompatible with <mutex> (and most other threading C++11 libraries)
Chandler Carruth
chandlerc at gmail.com
Wed Jun 25 04:14:06 PDT 2014
(sorry for the cross post, but this issue effects lots of people)
Takumi diagnosed a problem when Zach switched LLVM to use compile-time
multithreading, but it actually has little to do with the multithreading
decisions.
LLVM is rapidly moving to use more C++11 library features and more
multithreading features. I think this is a good thing. However, we're
hitting a specific issue on cygwin when bootstrapping: Clang doesn't
support the Cygwin __thread implementation (it's different... sadly...). As
a consequence, a *huge* amount of libstdc++'s multithreading primitives
when bootstrapping, including <mutex>.
I don't think the current situation is tenable -- we really shouldn't be
increasingly using C++11 in LLVM while trying to keep all of the
multithreading code away from the C++11 standard library. At some point, we
will fail because some other part of the library needed <mutex> (or
something), and get a really surprising breakage.
I see three options:
1) Give up on cygwin bootstrapping (I don't really like this, and I suspect
there are users of it)
2) Switch cygwin bootstrap to libc++ and fix libc++ to not require __thread
(seems rather gross and lots of work)
3) Implement __thread in cygwin mode ASAP.
Thoughts? I think we need to address this pretty quickly or we're just
going to start running into more failure modes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140625/b28e1d96/attachment.html>
More information about the llvm-dev
mailing list