[clang] 933d146 - Revert "[Driver] -m32: Add /usr/include/i386-linux-gnu for Debian"
Petr Hosek via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 22 11:58:36 PDT 2021
Author: Petr Hosek
Date: 2021-03-22T11:58:28-07:00
New Revision: 933d146f38c6d77a9b4fdde2b6b394f6ad9f8bf5
URL: https://github.com/llvm/llvm-project/commit/933d146f38c6d77a9b4fdde2b6b394f6ad9f8bf5
DIFF: https://github.com/llvm/llvm-project/commit/933d146f38c6d77a9b4fdde2b6b394f6ad9f8bf5.diff
LOG: Revert "[Driver] -m32: Add /usr/include/i386-linux-gnu for Debian"
This reverts commit 82f6e0dde29e6c6da27f64db5992eb539a57d21b which
hasn't addressed the 874bdc8e61662b5f39a9626b9132e0979fae556f issue.
Added:
Modified:
clang/lib/Driver/ToolChains/Linux.cpp
clang/test/Driver/linux-cross.cpp
Removed:
clang/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/.keep
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index 0df2d3793819..e889791d19b2 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -604,8 +604,13 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
return;
}
- // On Android and Debian, add /usr/include/$triple if exists.
- std::string MultiarchIncludeDir = getMultiarchTriple(D, getTriple(), SysRoot);
+ // On Android and Debian, add /usr/include/$triple if exists. On Debian, we
+ // can assume a GCC installation is available.
+ std::string MultiarchIncludeDir;
+ if (getTriple().isAndroid())
+ MultiarchIncludeDir = getMultiarchTriple(D, getTriple(), SysRoot);
+ else if (GCCInstallation.isValid())
+ MultiarchIncludeDir = GCCInstallation.getTriple().str();
if (!MultiarchIncludeDir.empty() &&
D.getVFS().exists(SysRoot + "/usr/include/" + MultiarchIncludeDir))
addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/" + MultiarchIncludeDir);
diff --git a/clang/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/.keep b/clang/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/.keep
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/clang/test/Driver/linux-cross.cpp b/clang/test/Driver/linux-cross.cpp
index 6fdd9193fa2f..fa07d615f4fc 100644
--- a/clang/test/Driver/linux-cross.cpp
+++ b/clang/test/Driver/linux-cross.cpp
@@ -34,8 +34,6 @@
// DEBIAN_X86_64_M32-SAME: {{^}} "-internal-isystem" "[[SYSROOT:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/backward"
// DEBIAN_X86_64_M32-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/local/include"
// DEBIAN_X86_64_M32-SAME: {{^}} "-internal-isystem" "[[SYSROOT:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include"
-// DEBIAN_X86_64_M32: "-internal-externc-isystem"
-// DEBIAN_X86_64_M32-SAME: {{^}} "[[SYSROOT]]/usr/include/i386-linux-gnu"
// DEBIAN_X86_64_M32: "-L
// DEBIAN_X86_64_M32-SAME: {{^}}[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/10/32"
// DEBIAN_X86_64_M32-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib32"
More information about the cfe-commits
mailing list