Using build clang on Mac OS

the question os mostly addressed to Apple folks.

I am having some issues with clang compiled on Mac OS. First thing is the search path for libc++ - running llvm+clang from build bin on basic c++ file
results in preprocessor errors because clang can’t find libc++. It seems that the main problem is that the default installed clang with libc++ with XCode is somewhere
in Application, and build clang is trying to find it somewhere in /usr/bin.

Building clang with libcxx and libcxxabi solves the problem, but then all the libc++ fails with error like
clang-3.9: error: no such file or directory: ‘/Users/prazek/llvm/projects/libcxx/test/support/"’.

I would like to not compile libc++ every time when I clear the build.
So I feel that there should be either good documentation for how to set it up on mac, or the default behaviour should not be so crappy. This makes me a little bit sad
because I would not expect to have problems like this on mac.


You may want to check out the recent thread “[cfe-dev] clang++ build from source is not able to find C++ headers”. Ideally we could filter the result of all these discussions into an FAQ.

– Sean Silva

Thanks for the thread. Having precise step-by-step description in FAQ would be helpful.