libclang1 has wrong standard include paths
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
llvm-toolchain-3.4 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Bug affects all versions of libclang1 I could test (3.3, 3.4 and 3.5).
The precise version of libclang I have is 1:3.4-1ubuntu3.
Running Ubuntu 14.04 (Linux Mint 17.1).
When building a minimal libclang program (refgen.cpp, attached) and using the "-print-
programs: =:/usr/
libraries: =../lib/
Notice the leading "../lib/clang/3.4" in "libraries", which does not make any sense and is likely missing part of the path. Notice also the leading ":" in "programs", which probably doesn't hurt, but looks suspicious.
For reference, running clang (3.4) with the same command line argument outputs:
programs: =/usr/bin:
libraries: =/usr/bin/
One can see here that the leading "/usr/bin/" has probably been stripped somehow from the "programs" and "libraries" search paths in libclang1.
The end result is that libclang1 does not find clang's standard headers, and falls back to using GCC's, which it does not support.
In my case, this means that if I try to parse even the simplest of files (test.cpp, attached) with this libclang1 and C++11 support enabled, the parsing fails because libclang1 is failing to understand GCC's SSE intrinsics in /usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
Compiling the minimal libclang program attached above using: lib/llvm- 3.4/include" -lclang-3.4 -lstdc++ -o refgen
clang refgen.cpp -std=c++11 -I"/usr/
(replacing clang by gcc here does not change anything)
Invoking the libclang program on the test file attached above using:
./refgen test.cpp -std=c++11