aboutsummaryrefslogtreecommitdiff
path: root/lld/MachO
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-11-25 21:48:27 -0500
committerNico Weber <thakis@chromium.org>2020-11-30 08:23:58 -0500
commitd20abb1ec3b6ff90cc4221e6a5865ae22fa2f5e9 (patch)
treefb2b59912fdb8a7d3e7b9f7236e4ffc1d06574f0 /lld/MachO
parent686988a50f5009df5a7f184b7debfe012b29bbf8 (diff)
downloadllvm-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.cpp4
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)