From 690056f99a30c9cf907eaedb002d997e377b39a1 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Sat, 11 Feb 2017 23:44:37 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294879 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index e14c14d391..87153c33fe 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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"); -- 2.40.0