summaryrefslogtreecommitdiff
path: root/lld/tools
diff options
context:
space:
mode:
authorHans Wennborg <hans@chromium.org>2022-11-05 04:37:45 +0100
committerHans Wennborg <hans@chromium.org>2022-11-07 18:28:33 +0100
commit19a7939404a3b932c26cd2a6a29f0669acebd702 (patch)
treea226d0e78a793ed5c24ea5f190a29fa7c78c5a7e /lld/tools
parent265a73043d34af25d88a238b84ed9c0c34321348 (diff)
downloadllvm-19a7939404a3b932c26cd2a6a29f0669acebd702.tar.gz
[lld] Check errors from expanding response files
Previously the response file expansion code would print the error, but lld would not exit, which was odd. lld does response file expansion in the different drivers, but it's also done in main() first, so it's enough to check there. By checking for these errors we would have caught when D136090 introduced a bug that made lld print errors for response files which contained "-rpath @foo". Differental revision: https://reviews.llvm.org/D137477
Diffstat (limited to 'lld/tools')
-rw-r--r--lld/tools/lld/lld.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/tools/lld/lld.cpp b/lld/tools/lld/lld.cpp
index b0e28d15fa29..700c0b770e20 100644
--- a/lld/tools/lld/lld.cpp
+++ b/lld/tools/lld/lld.cpp
@@ -89,7 +89,9 @@ static bool isPETarget(std::vector<const char *> &v) {
SmallVector<const char *, 256> expandedArgs(v.data(), v.data() + v.size());
BumpPtrAllocator a;
StringSaver saver(a);
- cl::ExpandResponseFiles(saver, getDefaultQuotingStyle(), expandedArgs);
+ cl::ExpansionContext ECtx(saver.getAllocator(), getDefaultQuotingStyle());
+ if (Error Err = ECtx.expandResponseFiles(expandedArgs))
+ die(toString(std::move(Err)));
for (auto it = expandedArgs.begin(); it + 1 != expandedArgs.end(); ++it) {
if (StringRef(*it) != "-m")
continue;