danalbert created this revision. danalbert added a reviewer: srhines. Herald added a reviewer: EricWF.
A handful of targets will try some default paths if --sysroot is not provided. If that is the case, it should be used for the libc++ header paths. 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 @@ -776,13 +776,14 @@ } std::string Linux::findLibCxxIncludePath() 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;
Index: lib/Driver/ToolChains/Linux.cpp =================================================================== --- lib/Driver/ToolChains/Linux.cpp +++ lib/Driver/ToolChains/Linux.cpp @@ -776,13 +776,14 @@ } std::string Linux::findLibCxxIncludePath() 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;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits