From 023819127004a588cbc48702b79db131be4a99aa Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Tue, 26 Feb 2019 08:41:03 -0800 Subject: [PATCH] [Driver] Always fall back to an arclite in the Xcode default toolchain (#22911) ...instead of the current toolchain, which we would have just searched by looking relative to the swiftc binary. rdar://problem/48044350 (cherry picked from commit e76b5a847ced33291f96470ae40407f928dc31dd) --- lib/Driver/DarwinToolChains.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Driver/DarwinToolChains.cpp b/lib/Driver/DarwinToolChains.cpp index 0ece134f93675..1e26ab873fa36 100644 --- a/lib/Driver/DarwinToolChains.cpp +++ b/lib/Driver/DarwinToolChains.cpp @@ -169,7 +169,9 @@ static bool findXcodeClangPath(llvm::SmallVectorImpl &path) { auto xcrunPath = llvm::sys::findProgramByName("xcrun"); if (!xcrunPath.getError()) { - const char *args[] = {"-f", "clang", nullptr}; + // Explicitly ask for the default toolchain so that we don't find a Clang + // included with an open-source toolchain. + const char *args[] = {"-toolchain", "default", "-f", "clang", nullptr}; sys::TaskQueue queue; queue.addTask(xcrunPath->c_str(), args, /*Env=*/llvm::None, /*Context=*/nullptr,