desktop-packages team mailing list archive
-
desktop-packages team
-
Mailing list archive
-
Message #107499
[Bug 1432882] Re: libclang1 has wrong standard include paths
(sorry, I meant of course "trusty", not "lucid", in the above post)
I confirm that the libclang from the above PPA (1:3.4.2-debian13trusty1)
does work correctly in trusty. In other words, when I compile the
example programs attached to this bug report with the libclang from this
PPA, the errors about ia32intrin.h are gone and parsing is fully
functional. I don't know if this is due to 1) a more recent upstream
libclang version (3.4.2 vs 3.4), 2) a more recent debian base, or 3)
tweaks specific to this PPA.
If someone familiar with the debian/ubuntu build system could take a look at the source of this PPA:
https://github.com/hATrayflood/llvm-ppa
... and compare to what is done for the official ubuntu packages, that would be great. I have tried myself, but the thing is so complex and globally unknown to me that I am completely lost. From what I could gather, it seems that the maintainer of the PPA actually has made a few modifications to the original debian packages, as can be seen from this diff file:
https://github.com/hATrayflood/llvm-ppa/blob/master/trusty/llvm-toolchain-3.4/debian.diff
Also, can someone else actually reproduce this issue on their side?
NB: Using the PPA libclang, the builtin search directories are similar to the original ubuntu version. So that lead was a dead end. Here is the output of -print-search-dirs:
programs: =:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../x86_64-linux-gnu/bin
libraries: =../lib/clang/3.4.2:/usr/lib/gcc/x86_64-linux-gnu/4.8:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib/../lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..:/lib:/usr/lib
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to llvm-toolchain-3.4 in Ubuntu.
https://bugs.launchpad.net/bugs/1432882
Title:
libclang1 has wrong standard include paths
Status in llvm-toolchain-3.4 package in Ubuntu:
New
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-search-dirs" command line argument to output the standard header search directories, libclang outputs the following:
programs: =:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../x86_64-linux-gnu/bin
libraries: =../lib/clang/3.4:/usr/lib/gcc/x86_64-linux-gnu/4.8:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib/../lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..:/lib:/usr/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:/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../x86_64-linux-gnu/bin
libraries: =/usr/bin/../lib/clang/3.4:/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8:/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib/../lib64:/usr/lib/x86_64-linux-gnu:/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../..:/lib:/usr/lib
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/gcc/x86_64-linux-gnu/4.8/include/ia32intrin.h, generating lots of errors:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ia32intrin.h:41:10: error: use of undeclared identifier '__builtin_ia32_bsrsi'
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ia32intrin.h:89:10: error: use of undeclared identifier '__builtin_ia32_rdpmc'
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ia32intrin.h:97:10: error: use of undeclared identifier '__builtin_ia32_rdtsc'
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ia32intrin.h:105:10: error: use of undeclared identifier '__builtin_ia32_rdtscp'
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ia32intrin.h:113:10: error: use of undeclared identifier '__builtin_ia32_rolqi'
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-3.4/+bug/1432882/+subscriptions
References