]> granicus.if.org Git - clang/commitdiff
[Driver] Use stem rather than filename for executable name
authorPetr Hosek <phosek@chromium.org>
Mon, 17 Oct 2016 22:02:53 +0000 (22:02 +0000)
committerPetr Hosek <phosek@chromium.org>
Mon, 17 Oct 2016 22:02:53 +0000 (22:02 +0000)
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

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

lib/Driver/Tools.cpp

index db473844d4cea400c3b5a665b808caa83bbf0a2a..33fa9ebad7446c8bb3e8f357b7da2036cc0f9d01 100644 (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");
   }