libcxx compilation using clang

I'm trying to build libc++ (libcxx) on a Windows machine with clang (built
with VC++ 10.0) using the buildit script. I'm getting the errors shown at
the end of the email. Could someone tell me if the compilation should be
including the MSVC version of the string.h file? Ideally I would like to
compile the library to LLVM bitcode or LLVM IR and not the native binary. I
compiled clang using MSVC. Has anybody succeeded in using this combination
to compile libcxx?

I appreciate any help you can provide.


clang++: warning: argument unused during compilation: '-arch x86_64'
In file included from ../src/algorithm.cpp:10:
In file included from ../include/algorithm:592:
In file included from ../include/cstring:61:
/Program Files (x86)/Microsoft Visual Studio 10.0/VC/include/string.h(290) :
error: expected expression
    return (_Src == NULL) ? 0 : wcsnlen(_Src, _MaxCount);
In file included from ../src/algorithm.cpp:10:
In file included from ../include/algorithm:592:
../include/cstring(94) : error: declaration conflicts with target of using
declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int
__c) {return ::strchr(__s, __c);}


clang cannot parse all the MSVC header files.
But you shouldn't see this particular error (string.h, line 290)
I am not familiar with the buildit script but is -fms-extensions used?

The buildit script can be found inside libcxx/lib. It doesn't use