This issue could be linked to this entry of the llvm libtooling FAQ:
http://clang.llvm.org/docs/LibTooling.html#libtooling-builtin-includes

Quoting:
"Clang tools need their builtin headers and search for them the same way Clang 
does. Thus, the default location to look for builtin headers is in a path 
$(dirname /path/to/tool)/../lib/clang/3.3/include relative to the tool binary. 
This works out-of-the-box for tools running from llvm’s toplevel binary 
directory after building clang-headers, or if the tool is running from the 
binary directory of a clang install next to the clang binary."

I guess this could explain the "../lib/clang/3.4" in libclang.

I have another machine running quantal, and on which I could install 
libclang1-3.3 and libclang1-3.4 from the llvm PPA (ppa:h-rayflood/llvm). Here 
too, the library search dirs start with the same "../lib/clang/", but these 
versions work perfectly. There must be something different in the way they are 
built, however from what I could gather this PPA is just taking the packages 
from Debian without modification:
http://http.debian.net/debian/pool/main/l/llvm-toolchain-3.4

I will try this approach in lucid, replacing the packages provided by
Ubuntu and report back.

-- 
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

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to