diff options
author | Nico Weber <thakis@chromium.org> | 2020-11-25 21:48:27 -0500 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2020-11-30 08:23:58 -0500 |
commit | d20abb1ec3b6ff90cc4221e6a5865ae22fa2f5e9 (patch) | |
tree | fb2b59912fdb8a7d3e7b9f7236e4ffc1d06574f0 /lld/MachO | |
parent | 686988a50f5009df5a7f184b7debfe012b29bbf8 (diff) | |
download | llvm-project-d20abb1ec3b6ff90cc4221e6a5865ae22fa2f5e9.tar.gz |
[mac/lld] Add support for response files
ld64 learned about them in Xcode 12, so we should too.
Differential Revision: https://reviews.llvm.org/D92149
Diffstat (limited to 'lld/MachO')
-rw-r--r-- | lld/MachO/DriverUtils.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/MachO/DriverUtils.cpp b/lld/MachO/DriverUtils.cpp index 0322c20fcb69..d17a8215f6a3 100644 --- a/lld/MachO/DriverUtils.cpp +++ b/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 @@ opt::InputArgList MachOOptTable::parse(ArrayRef<const char *> argv) { unsigned missingCount; SmallVector<const char *, 256> vec(argv.data(), argv.data() + argv.size()); + // Expand response files (arguments in the form of @<filename>) + // and then parse the argument again. + cl::ExpandResponseFiles(saver, cl::TokenizeGNUCommandLine, vec); opt::InputArgList args = ParseArgs(vec, missingIndex, missingCount); if (missingCount) |