Skip to content

Commit 04f3751

Browse files
authored
[Driver] Always fall back to an arclite in the Xcode default toolchain (#22923)
...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 e76b5a8)
1 parent 8c3a077 commit 04f3751

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Driver/DarwinToolChains.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ static bool findXcodeClangPath(llvm::SmallVectorImpl<char> &path) {
169169

170170
auto xcrunPath = llvm::sys::findProgramByName("xcrun");
171171
if (!xcrunPath.getError()) {
172-
const char *args[] = {"-f", "clang", nullptr};
172+
// Explicitly ask for the default toolchain so that we don't find a Clang
173+
// included with an open-source toolchain.
174+
const char *args[] = {"-toolchain", "default", "-f", "clang", nullptr};
173175
sys::TaskQueue queue;
174176
queue.addTask(xcrunPath->c_str(), args, /*Env=*/llvm::None,
175177
/*Context=*/nullptr,

0 commit comments

Comments
 (0)