Index: lld/MachO/DriverUtils.cpp =================================================================== --- lld/MachO/DriverUtils.cpp +++ lld/MachO/DriverUtils.cpp @@ -14,6 +14,7 @@ #include "llvm/Option/Arg.h" #include "llvm/Option/ArgList.h" #include "llvm/Option/Option.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Path.h" #include "llvm/TextAPI/MachO/TextAPIReader.h" @@ -68,6 +69,9 @@ unsigned missingCount; SmallVector vec(argv.data(), argv.data() + argv.size()); + // Expand response files (arguments in the form of @) + // and then parse the argument again. + cl::ExpandResponseFiles(saver, cl::TokenizeGNUCommandLine, vec); opt::InputArgList args = ParseArgs(vec, missingIndex, missingCount); if (missingCount) Index: lld/test/MachO/responsefile.test =================================================================== --- /dev/null +++ lld/test/MachO/responsefile.test @@ -0,0 +1,4 @@ +# RUN: echo --help > %t.rsp + +# RUN: %lld @%t.rsp | FileCheck %s +CHECK: OVERVIEW: LLVM Linker