aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-08 17:19:47 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-08 17:19:47 +0000
commitc44bc2d32f81d11b4c0e46c932ba42e673b50a49 (patch)
tree544b6f3a3e1d7ebee19d920d65291ad0ca2dec80 /lib/Driver/ToolChains.cpp
parentae7c25dab5ed7c8fc05462c8daf48e7d0945d364 (diff)
Add a default system include of '/include'. This isn't particularly
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
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r--lib/Driver/ToolChains.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index d787ee08e8..c3861efd16 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -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");
}