[Driver] Support response file on baremetal driver
authorPetr Hosek <phosek@google.com>
Wed, 19 Apr 2023 23:55:20 +0000 (23:55 +0000)
committerPetr Hosek <phosek@google.com>
Thu, 20 Apr 2023 02:45:26 +0000 (02:45 +0000)
All officially supported linkers should support response files and
this avoids issues when compiling on platforms such as Windows.

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

clang/lib/Driver/ToolChains/BareMetal.cpp

index c935758..38f26d0 100644 (file)
@@ -345,7 +345,8 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA,
   CmdArgs.push_back("-o");
   CmdArgs.push_back(Output.getFilename());
 
-  C.addCommand(std::make_unique<Command>(JA, *this, ResponseFileSupport::None(),
+  C.addCommand(std::make_unique<Command>(JA, *this,
+                                         ResponseFileSupport::AtFileCurCP(),
                                          Args.MakeArgString(TC.GetLinkerPath()),
                                          CmdArgs, Inputs, Output));
 }