summaryrefslogtreecommitdiffstats
path: root/clang/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
commit475ab6ad7b6017782cc61c91912511e9f40a2fa3 (patch)
treefb0166aa537b8705c033a4e908e225ee3dbcc078 /clang/lib/Driver/ToolChains.cpp
parent60b54f19e6a88c43abc6148c38d0a0ecc69a55f6 (diff)
downloadbcm5719-llvm-475ab6ad7b6017782cc61c91912511e9f40a2fa3.tar.gz
bcm5719-llvm-475ab6ad7b6017782cc61c91912511e9f40a2fa3.zip
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. llvm-svn: 144089
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
-rw-r--r--clang/lib/Driver/ToolChains.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index d787ee08e84..c3861efd16a 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/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");
}
OpenPOWER on IntegriCloud