depot/third_party/nixpkgs/pkgs/development/compilers/swift/patches/llvm-toolchain-dir.patch
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

24 lines
1 KiB
Diff

Use the Nix include dirs and gcc runtime dir, when no sysroot is configured.
--- clang/lib/Driver/ToolChains/Linux.cpp 2018-10-05 18:01:15.731109551 +0200
+++ clang/lib/Driver/ToolChains/Linux.cpp 2018-10-05 18:00:27.959509924 +0200
@@ -665,7 +665,7 @@
// Check for configure-time C include directories.
StringRef CIncludeDirs(C_INCLUDE_DIRS);
- if (CIncludeDirs != "") {
+ if (CIncludeDirs != "" && (SysRoot.empty() || SysRoot == "/")) {
SmallVector<StringRef, 5> dirs;
CIncludeDirs.split(dirs, ":");
for (StringRef dir : dirs) {
--- clang/lib/Driver/ToolChains/Gnu.cpp 2019-10-26 09:49:27.003752743 +0200
+++ clang/lib/Driver/ToolChains/Gnu.cpp 2019-10-26 09:50:49.067236497 +0200
@@ -1743,7 +1743,7 @@
// If we have a SysRoot, ignore GCC_INSTALL_PREFIX.
// GCC_INSTALL_PREFIX specifies the gcc installation for the default
// sysroot and is likely not valid with a different sysroot.
- if (!SysRoot.empty())
+ if (!(SysRoot.empty() || SysRoot == "/"))
return "";
return GCC_INSTALL_PREFIX;