[cfe-dev] Cygwin bootstrap is incompatible with <mutex> (and most other threading C++11 libraries)
NAKAMURA Takumi
geek4civic at gmail.com
Wed Jun 25 07:01:00 PDT 2014
I reverted <mutex>, since also clang-native-mingw32-win7 had been broken.
There were two ways of issues, in mingw32 (not w64) and cygwin.
For mingw32, it seems <mutex> is configured without __thread. Some
features, like "once", are unavailable.
When we reintroduce <mutex> in the tree, we should make mingw32
builder obsoleted or migrated to mingw-w64.
For Cygwin, I can suggest an option,
3a) Implement __thread in near future. Till then,
3a-1) Give up bootstrapping. Cygwin-g++-4.8 can build the tree, though.
3a-2) Apply local patch in the builder to suppress unsupported
features like <mutex>.
Conclusion: Go ahead!
I supposed, when I reverted <mutex>, it were trivial. I won't disturb
any more if we are going toward c++11.
2014-06-25 20:14 GMT+09:00 Chandler Carruth <chandlerc at gmail.com>:
> (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.
More information about the cfe-dev
mailing list