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
This commit is contained in:
Chandler Carruth 2011-11-08 17:19:47 +00:00
parent 60b54f19e6
commit 475ab6ad7b
1 changed files with 5 additions and 0 deletions

View 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");
}