I recently did the same thing, so hopefully I can help. LLVM's libc++ does depend on libc. I actually documented most of what I need to implement in my libc
earlier this year.
Quote:
If all I need to do is define a few arch/OS specific constants, I'm fine with creating blank dummy headers and then implementing what's missing.
Basically that's what I did. There's a whole lot of things that must be defined (looking at you wchar.h), but if you just want to get up and running you can just write stubs (return 0/nullptr where appropriate). I haven't yet found a use for wcsncmp, wcsxfrm, wcscspn, wcslen, wcsspn, wcswtfhwmnylttrscniaddhr, but as long as the linker sees the definition, libc++ is happy. EDIT: Actually spoke too soon, you can even get away with omitting the definitions and just have declarations for a fair bit of that stuff.
As far as the arch/OS specific constants, that's more of a minefield that I'm currently navigating. You can see in an older
file (Warning: read on an empty stomach) that I really had to carefully pick and choose definitions, looking through each header and determine the right combination of things to define just to get going, even masquerading as Windows for some parts like -D_LIBCPP_USING_WIN32_RANDOM. To be clear: that was *very* hacky and disgusting and I know more experienced members will rightfully call me out on it; part of the major overhaul I'm doing is to perform that correctly this time.