Index: clang/lib/Driver/ToolChains/BareMetal.cpp =================================================================== --- clang/lib/Driver/ToolChains/BareMetal.cpp +++ clang/lib/Driver/ToolChains/BareMetal.cpp @@ -345,7 +345,14 @@ CmdArgs.push_back("-o"); CmdArgs.push_back(Output.getFilename()); - C.addCommand(std::make_unique(JA, *this, ResponseFileSupport::None(), + const char *Linker = Args.MakeArgString(TC.GetLinkerPath()); + ResponseFileSupport LinkerResponseFileSupport = ResponseFileSupport::AtFileCurCP(); + if (llvm::sys::path::filename(Linker) != "ld.lld" && + llvm::sys::path::stem(Linker) != "ld.lld") { + LinkerResponseFileSupport = ResponseFileSupport::None(); + } + + C.addCommand(std::make_unique(JA, *this, LinkerResponseFileSupport, Args.MakeArgString(TC.GetLinkerPath()), CmdArgs, Inputs, Output)); }