@@ -230,15 +230,20 @@ toolchains::Darwin::addLinkerInputArgs(InvocationInfo &II,
230
230
ArgStringList &Arguments = II.Arguments ;
231
231
if (context.shouldUseInputFileList ()) {
232
232
Arguments.push_back (" -filelist" );
233
+ const auto whichFiles = context.Inputs .empty ()
234
+ ? FilelistInfo::WhichFiles::PrimaryInputs
235
+ : FilelistInfo::WhichFiles::Input;
233
236
Arguments.push_back (context.getTemporaryFilePath (" inputs" , " LinkFileList" ));
234
- II.FilelistInfos .push_back ({Arguments.back (), file_types::TY_Object,
235
- FilelistInfo::WhichFiles::PrimaryInputs});
237
+ II.FilelistInfos .push_back (
238
+ {Arguments.back (), file_types::TY_Object, whichFiles});
239
+ assert ((context.Inputs .empty () || context.InputActions .empty ()) &&
240
+ " If both are non-empty the filelist won't work" );
236
241
} else {
237
242
addPrimaryInputsOfType (Arguments, context.Inputs , context.Args ,
238
243
file_types::TY_Object);
244
+ addInputsOfType (Arguments, context.InputActions , file_types::TY_Object);
239
245
}
240
246
241
- addInputsOfType (Arguments, context.InputActions , file_types::TY_Object);
242
247
243
248
if (context.OI .CompilerMode == OutputInfo::Mode::SingleCompile)
244
249
addInputsOfType (Arguments, context.Inputs , context.Args ,
0 commit comments