Building libcxx on Windows

I was wondering if there’s any definitive source of information on this. I’m aware of this page: http://clang.llvm.org/docs/MSVCCompatibility.html but that is all I’ve managed to find so far. This page seems to imply that libcxx is buildable (or there’s a WIP to make it so) with MSVC. Is that the case?

What other Windows builds are supported, e.g. can I build with clang and windows sys headers? I presume I can build with MingW?

FYI I’m currently trying to build libcxx using MSVC but with custom “posix-like” sys headers and runtime. Obvious blockers to me doing this are things like the lack of intrinsic support for atomics, e.g. __sync_add_and_fetch. I can solve these issue fairly easily but before I do I’d like to understand if I need to.

Feel free to shunt me to an appropriate doc, page or post if this is a dupe.

I think the short version is that Windows support in libc++ isn’t really there yet. The core data structures and algorithms have been ported, but the new C++11 threading library stuff relies on pthreads.

In a more general sense, most LLVM projects, including clang and libc++, support both the MinGW toolchain and the MSVC toolchain. The more your toolchain (system headers, compiler builtins, etc) diverges from one of these two major ones, the less likely it is that things will work.

If you want to compile libc++ in a way that assumes that “posix works”, then you probably want to configure it to target mingw and make changes from there.