================
@@ -767,6 +770,18 @@ void Linux::AddClangSystemIncludeArgs(const ArgList
&DriverArgs,
if (std::optional<std::string> Path = getStdlibIncludePath())
addSystemInclude(DriverArgs, CC1Args, *Path);
+ // Add multilib variant include paths in priority order.
+ for (const Multilib &M : getOrderedMultilibs()) {
+ if (M.isDefault())
+ continue;
+ if (std::optional<std::string> StdlibIncDir = getStdlibIncludePath()) {
+ SmallString<128> Dir(*StdlibIncDir);
+ llvm::sys::path::append(Dir, M.includeSuffix());
+ if (D.getVFS().exists(Dir))
+ addSystemInclude(DriverArgs, CC1Args, Dir);
+ }
+ }
----------------
petrhosek wrote:
We usually put the multilib directories first so they take the precedence over
the generic ones.
```suggestion
// Add multilib variant include paths in priority order.
for (const Multilib &M : getOrderedMultilibs()) {
if (M.isDefault())
continue;
if (std::optional<std::string> StdlibIncDir = getStdlibIncludePath()) {
SmallString<128> Dir(*StdlibIncDir);
llvm::sys::path::append(Dir, M.includeSuffix());
if (D.getVFS().exists(Dir))
addSystemInclude(DriverArgs, CC1Args, Dir);
}
}
if (std::optional<std::string> Path = getStdlibIncludePath())
addSystemInclude(DriverArgs, CC1Args, *Path);
```
https://github.com/llvm/llvm-project/pull/188584
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits