]> granicus.if.org Git - clang/commitdiff
[Driver] Use stem() and not filename().
authorDavide Italiano <davide@freebsd.org>
Sat, 11 Feb 2017 23:44:37 +0000 (23:44 +0000)
committerDavide Italiano <davide@freebsd.org>
Sat, 11 Feb 2017 23:44:37 +0000 (23:44 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294879 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index e14c14d391447a5e1f74db8002ef688945e80f2e..87153c33fe547cd1122d4ee6f9cf61122d8b8587 100644 (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");