[cfe-users] How can I CHANGE the system include path of clang?

Hongxu Chen leftcopy.chx at gmail.com
Tue May 21 02:44:42 PDT 2013


Hi,
  I am using a deb packed version of clang3.3, and I am annoyed the
  default system include paths, which always uses the gcc-4.6 include
  paths. Here is the result after running
  `clang -v -xc++ /dev/null -fsyntax-only -nostdinc'

  Ubuntu clang version 3.3-1~exp1 (trunk) (based on LLVM 3.3)
Target: x86_64-pc-linux-gnu
Thread model: posix
 "/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -disable-free -disable-llvm-verifier -main-file-name null -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.22 -v -nostdsysteminc -nobuiltininc -resource-dir /usr/bin/../lib/clang/3.3 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6 -fdeprecated-macro -fdebug-compilation-dir /home/hongxuchen/.bin -ferror-limit 19 -fmessage-length 186 -mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops -x c++ /dev/null
clang -cc1 version 3.3 based upon LLVM 3.3 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
End of search list.

So is there any way to completely exclude the `internal-isystem' part
and specify my own include path(say, those paths that used by gcc-4.8) totally?

-- 
Regards,
Hongxu Chen




More information about the cfe-users mailing list