summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2016-05-17 19:01:16 +0000
committerYaron Keren <yaron.keren@gmail.com>2016-05-17 19:01:16 +0000
commit5439b64af08c3410dfd1c009da17da4200748b03 (patch)
treed77254f77fec93a1df9f15423b5538d8d42073c9 /clang/lib
parentbfe3801d1670a81dc704bbf1a805570b46a34455 (diff)
downloadbcm5719-llvm-5439b64af08c3410dfd1c009da17da4200748b03.tar.gz
bcm5719-llvm-5439b64af08c3410dfd1c009da17da4200748b03.zip
Teach clang to look for libcxx in /usr/local/include/c++ on Linux
As The default CMAKE install prefix is /usr/local ( https://cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html ), sudo ninja install ends up installing clang, LLVM and libcxx under /usr/local. In development scenario, when clang is run from the build location it will not find libcxx at neither (build location)/../include/c++ nor /usr/include/c++. This patch lets development clang find system installed libcxx without adding -isystem /usr/local/include/c++. Also addresses the FIXME by explaining the use-case for these include paths. llvm-svn: 269801
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/ToolChains.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index d296980ce7b..49e8c06a75f 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -4130,11 +4130,11 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
const std::string LibCXXIncludePathCandidates[] = {
DetectLibcxxIncludePath(getDriver().Dir + "/../include/c++"),
-
- // We also check the system as for a long time this is the only place
- // Clang looked.
- // FIXME: We should really remove this. It doesn't make any sense.
- DetectLibcxxIncludePath(getDriver().SysRoot + "/usr/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++") };
for (const auto &IncludePath : LibCXXIncludePathCandidates) {
if (IncludePath.empty() || !getVFS().exists(IncludePath))
continue;
OpenPOWER on IntegriCloud