[Driver] Use stem() and not filename().

On Windows the filename might have an extension, namely
`.exe`, so the search will fail. Sorry, I don't have a
good way to test this as it seems to fail only in some
weird configurations. r284430 has the same modification
for Fuchsia.

llvm-svn: 294879
This commit is contained in:
Davide Italiano 2017-02-11 23:44:37 +00:00
parent 04840ab752
commit 4efbbce4d1
1 changed files with 1 additions and 1 deletions

View File

@ -10163,7 +10163,7 @@ void gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
Args.ClaimAllArgs(options::OPT_w);
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
if (llvm::sys::path::filename(Exec) == "lld") {
if (llvm::sys::path::stem(Exec) == "lld") {
CmdArgs.push_back("-flavor");
CmdArgs.push_back("old-gnu");
CmdArgs.push_back("-target");