Index: lld/COFF/DriverUtils.cpp =================================================================== --- lld/COFF/DriverUtils.cpp +++ lld/COFF/DriverUtils.cpp @@ -728,9 +728,18 @@ opt::InputArgList Args = Table.ParseArgs(Vec, MissingIndex, MissingCount); // Expand response files (arguments in the form of @) - // and then parse the argument again. - cl::ExpandResponseFiles(Saver, getQuotingStyle(Args), Vec); - Args = Table.ParseArgs(Vec, MissingIndex, MissingCount); + // and then parse the argument again if it exists. + bool RspExists = false; + for (const char* Arg : Vec) { + if (Arg != nullptr && Arg[0] == '@') { + RspExists = true; + break; + } + } + if (RspExists) { + cl::ExpandResponseFiles(Saver, getQuotingStyle(Args), Vec); + Args = Table.ParseArgs(Vec, MissingIndex, MissingCount); + } // Print the real command line if response files are expanded. if (Args.hasArg(OPT_verbose) && Argv.size() != Vec.size()) {