[Driver] Use stem rather than filename for executable name

When comparing the linker name in Fuchsia driver, use stem rather
than filename to get the name of the linker becase on Windows, the
filename will have an extension.

Differential Revision: https://reviews.llvm.org/D25700

llvm-svn: 284430
This commit is contained in:
Petr Hosek 2016-10-17 22:02:53 +00:00
parent 9d58e362d2
commit b406388e5f
1 changed files with 1 additions and 1 deletions

View File

@ -10060,7 +10060,7 @@ void fuchsia::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).equals_lower("lld")) {
if (llvm::sys::path::stem(Exec).equals_lower("lld")) {
CmdArgs.push_back("-flavor");
CmdArgs.push_back("gnu");
}