> if we're building on a system that doesn't support threads (looks like your specific case is some unix variant that doesn't have the pthreads library), you want libc++ to still compile.
Yes, I'm building a bare-metal toolchain, so there are no threads, and no pthread library.

>Should we be also removing the defer_lock_t types and friends?
Oops, missed those.

>Also, is it better to walk around and ifdef out uses of pthread_mutex_t (like in algorithm.cpp) or to provide some sort of non-exported inline types that abstracts mutex and cond variable (which would be distinct from std::mutex/std::condition_variable) that just compile out to nothing?
I could see that making a lot of sense when there's more than one choice of underlying threading library (say, windows), and that's what I originally started to do... but it made a bit of a mess, so I went for the simpler option for now.