AddMultilibIncludeArgs(DriverArgs, CC1Args);
- if (getTriple().getArch() == llvm::Triple::x86) {
- std::string Path = SysRoot + "/usr/include/i386-gnu";
- if (D.getVFS().exists(Path))
- addExternCSystemInclude(DriverArgs, CC1Args, Path);
- }
+ // On systems using multiarch, add /usr/include/$triple before
+ // /usr/include.
+ std::string MultiarchIncludeDir = getMultiarchTriple(D, getTriple(), SysRoot);
+ if (!MultiarchIncludeDir.empty() &&
+ D.getVFS().exists(SysRoot + "/usr/include/" + MultiarchIncludeDir))
+ addExternCSystemInclude(DriverArgs, CC1Args,
+ SysRoot + "/usr/include/" + MultiarchIncludeDir);
// 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