3

So I know Clang depends (most of the time) on Gnu's libstdc++3, but after building gcc 4.7.0 (cuz' of awesome!) I seem to have run into a problem, all the paths for clang are wrong. Do I need to clean my build directory and start from scratch for clang, specifically it gives me the error bits/c++config.h missing, although it is there and builds just fine with gcc

I am on Linux x86, Ubuntu 12.04

alexmherrmann
  • 1,055
  • 2
  • 9
  • 17

1 Answers1

5

Yes, the paths for GCC's headers and libs include the version, 4.7.0 in your case, so you'll need to rebuild clang with --with-gcc-toolchain=... and reinstall it

Jonathan Wakely
  • 166,810
  • 27
  • 341
  • 521
  • do I use --with-gcc-toolchain= pointing to the include directory? I assume this will work with the cmake build too. – alexmherrmann May 30 '12 at 18:15
  • No, pointing to the same directory gcc is installed in, so probably the dir above the include dir. The option is for configure, not make. – Jonathan Wakely May 30 '12 at 20:49
  • It still errors out, could you give an exact example? I've tried the prefix I used with gcc, and the actual build directory – alexmherrmann May 31 '12 at 01:10
  • 1
    "errors out" is very vague. What fails, the configure step? the make step? the install step? Don't expect much help if you can't be more specific. I think I used `../llvm/configure --prefix=/opt/llvm --with-gcc-toolchain=/opt/gcc` where I installed GCC with `--prefix=/opt/gcc` – Jonathan Wakely May 31 '12 at 01:32
  • Just checked the build and I also used `--with-extra-ld-options=-W l,-R,/opt/gcc/lib64 CXX=/opt/gcc/bin/g++ CC=/opt/gcc/bin/gcc CPP=/opt/gcc/bin/cpp` to ensure clang is built with that same version of gcc (rather than another gcc, or an older version of clang) and that the clang binaries can find the right gcc shared libraries at runtime. Those options are probably not be needed for the common case. – Jonathan Wakely May 31 '12 at 10:06