[cfe-dev] Issues with C++ stdlib include paths and Clang compilation.

Rocco Moretti via cfe-dev cfe-dev at lists.llvm.org
Thu Dec 10 08:34:38 PST 2015


Hello,

I'm having difficulties compiling the Clang 3.7.0 release. For this I'm
attempting to use gcc 5.2.0 installed in a non-standard location (as the
system compiler is gcc 4.4, and not something I have authorization to
update).

I'm using the --with-gcc-toolchain option to the cmake command to point to
the directory of the gcc 5.2.0 install, and I do get the "The CXX compiler
identification is GNU 5.2.0" messages. (But it does this even when I omit
the --with-gcc-toolchain option, as I've set the CC and CXX environment
variables.)

However, when I attempt to use the compiler, I'm apparently getting the
system gcc 4.4 include search paths for the standard library, rather than
the 5.2.0 paths:

$ bin/clang++ -E -x c++ - -v < /dev/null
...
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7
 /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward
 /usr/local/include
 /path/to/clang/3.7.0/build2/bin/../lib/clang/3.7.0/include
 /usr/include
End of search list.
...

Am I correct that my compile was unable to find the gcc 5.2.0 C++ standard
library, or am I thinking about this in the wrong fashion?

My Google searching and different compilation attempts haven't been very
successful. The --with-gcc-toolchain option isn't documented all that well,
specifying just that it's "where gcc is installed", but not saying anything
about what, exactly, is expected from that directory (I presume it's the
same as the install prefix passed to the GCC compile; the directory which
contains the bin/ lib/ include/, etc. directories where the gcc version
is), or what will happen if the C++ stdlib is not found in that directory
(is there any error message?).

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151210/9133bae6/attachment.html>


More information about the cfe-dev mailing list