diff options
Diffstat (limited to 'clang/Driver/clang.cpp')
-rw-r--r-- | clang/Driver/clang.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp index 79166fb0bdf..525c27faccc 100644 --- a/clang/Driver/clang.cpp +++ b/clang/Driver/clang.cpp @@ -1098,8 +1098,11 @@ void InitializeIncludePaths(const char *Argv0, HeaderSearch &Headers, MainExecutablePath.eraseComponent(); // Remove /clang from foo/bin/clang MainExecutablePath.eraseComponent(); // Remove /bin from foo/bin MainExecutablePath.appendComponent("Headers"); // Get foo/Headers - Init.AddPath(MainExecutablePath.c_str(), InitHeaderSearch::After, - false, false, false); + + // We pass true to ignore sysroot so that we *always* look for clang headers + // relative to our executable, never relative to -isysroot. + Init.AddPath(MainExecutablePath.c_str(), InitHeaderSearch::System, + false, false, false, true /*ignore sysroot*/); } if (!nostdinc) |