I am experiencing issues with setting up clang on CentOS 6.9. The machine I work on is a university machine, as such I cannot install any additional software.
Compiling clang works just fine. However, clang cannot reliably build software. I need to build shadow ( https://shadow.github.io/ ) and one of the errors I get, is:
Code: Select all
In file included from [...]/shadow/src/plugin/llvm-hoist-pass/HoistGlobals.cpp:19:
In file included from ~/.shadow/include/llvm/Pass.h:381:
In file included from ~/.shadow/include/llvm/PassSupport.h:27:
In file included from ~/.shadow/include/llvm/PassRegistry.h:20:
In file included from ~/.shadow/include/llvm/ADT/DenseMap.h:17:
In file included from ~/.shadow/include/llvm/ADT/DenseMapInfo.h:17:
In file included from ~/.shadow/include/llvm/ADT/ArrayRef.h:13:
In file included from ~/.shadow/include/llvm/ADT/Hashing.h:49:
In file included from ~/.shadow/include/llvm/Support/Host.h:17:
In file included from ~/.shadow/include/llvm/ADT/StringMap.h:18:
In file included from ~/.shadow/include/llvm/Support/Allocator.h:24:
In file included from ~/.shadow/include/llvm/ADT/SmallVector.h:29:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/memory:83:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/shared_ptr.h:146:24: error: cannot use typeid with -fno-rtti
{ return __ti == typeid(_Deleter) ? &_M_del._M_del : 0; }
Code: Select all
$ `gcc -print-prog-name=cc1plus` -v
[ ... ]
#include "..." search starts here:
#include <...> search starts here:
[...]
/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64- redhat-linux/4.8.2/../../../../include/c++/4.8.2
/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64- redhat-linux/4.8.2/../../../../include/c++/4.8.2/x86_64- redhat-linux
/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64- redhat-linux/4.8.2/../../../../include/c++/4.8.2/backward
/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64- redhat-linux/4.8.2/include
/usr/local/include
/opt/rh/devtoolset-2/root/usr/include
/usr/include
Code: Select all
$ clang -v
clang version 3.8.0 (tags/RELEASE_380/final)
[...]
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/3.4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.4.7
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.4.7
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
Code: Select all
-bash-4.1$ ls /usr/lib/gcc/x86_64-redhat-linux/
3.4.6 4.4.4 4.4.7
I also tried building llvm's libcxx along with clang, but that didn't work either (I will post the error if you are interested, but I have to build llvm again for this.)
On the Internet, one finds hacks to change stdlib-include paths for gcc, but that broke compilation for hello wold.. I am a bit clueless now. I think, the easiest way would be to get my self-compiled gcc to use its own stdlib and not the system's one, but I don't know how this will work.
Summing up, I need to get clang 3.8 working and I am limited to installing software myself (no root-privileges). Also I have no experience with CentOs, so I cannot tell if our CentOS is misconfigured. I'd be glad for any help on this!