[cfe-dev] Clang fail to find C++ header on non-x86 platform

陳韋任 (Wei-Ren Chen) chenwj at iis.sinica.edu.tw
Tue Oct 9 02:42:25 PDT 2012


Hi all,

  Clang seems to have issues while searching for C++ header on non-x86
platforms. One example is test case PCH/cxx-typeid.cpp, clang can't find
header typeinfo on ARM, and PowerPC also has the same problem [1]. At
first, it complains header "typeinfo" can't be found, so I add path
"/usr/include/c++/4.6/". Then it complains header "bits/c++config.h"
can't be found. I add "/usr/include/c++/4.6/arm-linux-gnueabihf"
for it. The final RUN line becomes,

  // RUN: %clang -v -I /usr/include/c++/4.6/ -I /usr/include/c++/4.6/arm-linux-gnueabihf -include %S/cxx-typeid.h -fsyntax-only -Xclang -verify %s

Interesting, this time clang complains it can't find header
"typeinfo". I check this with "-v", and it shows,

---
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.6
 /usr/include/c++/4.6/arm-linux-gnueabihf
 /usr/local/include
 /nfs_home/chenwj/llvm-3.1/svn/arm3/Release+Asserts/bin/../lib/clang/3.2/include
 /usr/include
 /usr/include/arm-linux-gnueabihf
End of search list.
/nfs_home/chenwj/llvm-3.1/svn/llvm/tools/clang/test/PCH/cxx-typeid.h:3:10: fatal error: 'typeinfo' file not found
#include <typeinfo>
         ^
1 error generated.
---

It does search "/usr/include/c++/4.6" where typeinfo reside in, but
still report it can't find typeinfo. Any idea? Thanks.

Regards,
chenwj

[1]
http://bb.pgr.jp/builders/clang-ppc-linux/builds/479/steps/test_clang/logs/stdio

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj




More information about the cfe-dev mailing list