diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 11c722e67625..db9d3972f2a4 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -62,7 +62,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, ArgStringList CpArgs; CpArgs.push_back(InputPath); CpArgs.push_back(Args.MakeArgString(OutputPath.c_str())); - C.getJobs().addJob(new Command("cp", CpArgs)); + const char *Exec = + Args.MakeArgString(getToolChain().GetProgramPath(C, "cp").c_str()); + C.getJobs().addJob(new Command(Exec, CpArgs)); } } else { assert(isa(JA) && "Invalid action for clang tool.");