[PATCH] D45292: [Driver] Obey computed sysroot when finding libc++ headers.

Dan Albert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 2 12:34:37 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC331389: [Driver] Obey computed sysroot when finding libc++ headers. (authored by danalbert, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D45292?vs=141069&id=144915#toc

Repository:
  rC Clang

https://reviews.llvm.org/D45292

Files:
  lib/Driver/ToolChains/Linux.cpp


Index: lib/Driver/ToolChains/Linux.cpp
===================================================================
--- lib/Driver/ToolChains/Linux.cpp
+++ lib/Driver/ToolChains/Linux.cpp
@@ -793,13 +793,14 @@
 
 void Linux::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
                                   llvm::opt::ArgStringList &CC1Args) const {
+  const std::string& SysRoot = computeSysRoot();
   const std::string LibCXXIncludePathCandidates[] = {
       DetectLibcxxIncludePath(getDriver().Dir + "/../include/c++"),
       // If this is a development, non-installed, clang, libcxx will
       // not be found at ../include/c++ but it likely to be found at
       // one of the following two locations:
-      DetectLibcxxIncludePath(getDriver().SysRoot + "/usr/local/include/c++"),
-      DetectLibcxxIncludePath(getDriver().SysRoot + "/usr/include/c++") };
+      DetectLibcxxIncludePath(SysRoot + "/usr/local/include/c++"),
+      DetectLibcxxIncludePath(SysRoot + "/usr/include/c++") };
   for (const auto &IncludePath : LibCXXIncludePathCandidates) {
     if (IncludePath.empty() || !getVFS().exists(IncludePath))
       continue;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45292.144915.patch
Type: text/x-patch
Size: 1147 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180502/7099c741/attachment.bin>


More information about the cfe-commits mailing list