Clang 3.2 build broken after building gcc 4.7
Asked Answered
T

1

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

Threshold answered 30/5, 2012 at 2:46 Comment(1)
ahh sorry, linux x86, ubuntu 12.04. updatedThreshold
M
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

Minacious answered 30/5, 2012 at 8:48 Comment(5)
do I use --with-gcc-toolchain= pointing to the include directory? I assume this will work with the cmake build too.Threshold
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.Minacious
It still errors out, could you give an exact example? I've tried the prefix I used with gcc, and the actual build directoryThreshold
"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/gccMinacious
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.Minacious

© 2022 - 2024 — McMap. All rights reserved.