Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What is the easiest way to setup full Clang, libc++ and LLVM as default global toolchain? All of my attempts to build it, in most of the configurations I could think of, resulted in working Clang, but it didn't use libc++ headers, but default GCC's libstd++'s ones, resulting in numerous faults in incompatible pieces of library code.

I would like it working out of the box, without having to do magic in .bashrc or passing all those -stdlib=libc++ and -lc++ to compiler and linker.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted
+50

Judging on how LLVM and Clang have been integrated into FreeBSD's base, i think you will need to hack Clang's internals to set library and headers paths (lib/Frontend/InitHeaderSearch.cpp) for your system.

Using libc++ as default definitely needs changing the code (grep lib/Frontend/CompilerInvocation.cpp for "UseLibcxx"). You will probably need to hack system linker too to change -lstdc++ to -lc++.

Personally, i'd recommend you just setting CC, CXX, CFLAGS, CXXFLAGS and other vars to achieve same result without much hassle. It works for me flawlessly on FreeBSD.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.