Building with C++11 ("-std=c++0x" or "-std=c++11") seems to cause problems with the GCC libstdc++ headers. The status page links to patches that are supposed to make libstdc++-4.4 and libstdc++-4.7 work. I'm not sure if they work right on Linux, or if they break compilation with GCC. However, the 4.4 patch applies cleanly on RHEL6:
cd /usr/include/c++/4.4.4 sudo patch -p1 < ../libstdc++4.4-clang0x.patch
I made a backup of the 4.4.4 directory first. Even after the patch, I'm still getting errors when trying to compile as C++11. There are also errors coming from the Clang headers.
Downloaded LLVM 3.3 and related archives; extracted. I think this is right:
mv cfe-3.3.src llvm-3.3.src/tools/clang mv compiler-rt-3.3.src llvm-3.3.src/projects/compiler-rt mv clang-tools-extra-3.3.src llvm-3.3.src/tools/clang/tools/extra
I've built non-optimized for developing against Clang / libclang:
mkdir build33 cd build33 ../llvm-3.3.src/configure --prefix=/opt/llvm33
Could add the
--enable-optimized switch if using for compilation.
with-gcc-toolchainoption can work with this
Trying to get it to find the 4.4 standard library by using GCC 4.4 to build:
mkdir build-ac cd build-ac export CC=gcc44 export CXX=g++44 ../configure --prefix=/opt/llvm31 time nice make
Trying with CMake:
Messed up the first time (forgot to change the prefix) and had to remake.
Still not working. Without GCC_INSTALL_PREFIX (probably this one is not correct), it picks up the 4.1.2 headers; with it, it doesn't work for some other reason.