]> granicus.if.org Git - clang/commitdiff
Add a default system include of '/include'. This isn't particularly
authorChandler Carruth <chandlerc@gmail.com>
Tue, 8 Nov 2011 17:19:47 +0000 (17:19 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 8 Nov 2011 17:19:47 +0000 (17:19 +0000)
useful when using Clang as a system-compiler, but its harmless. When
using Clang as a cross-compiler, this can be very handy as quite a few
toolchains ship their libc headers here rather than under
'/usr/include'.

For reference, this is the beginning of my work to also make the Clang
driver more suitable as a cross-compiler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144089 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index d787ee08e849a9e2f1880e566fc5ad094fbd8304..c3861efd16af16a6a7283fee4b81c228649ef2b8 100644 (file)
@@ -1987,6 +1987,11 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
   if (getTriple().getOS() == llvm::Triple::RTEMS)
     return;
 
+  // Add an include of '/include' directly. This isn't provided by default by
+  // system GCCs, but is often used with cross-compiling GCCs, and harmless to
+  // add even when Clang is acting as-if it were a system compiler.
+  addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include");
+
   addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include");
 }