[PATCH] D63024: [LLD] [Driver] Look for -flavor/-m in response files as well

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 14:29:44 PDT 2019


rnk added a comment.

For links that use response files (i.e. most of them) this effectively leaks a second copy of the entire response file. Every argument needs to be put in the string saver so it can be null terminated. Response files tend to be large enough that I'd prefer it if we didn't do that.

One way we could address this is to try to calculate the flavor twice:

- First, use the unexpanded arguments to guess the flavor
- Use the guessed flavor to expand response files: Windows tokenization for lld-link, GNU for everyone else
- Re-parse the flavor using the expanded arguments, and call the appropriate entry point with those arguments
- Remove existing rsp expansion code

This is kind of what clang does:
https://github.com/llvm/llvm-project/blob/master/clang/tools/driver/driver.cpp#L334


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63024/new/

https://reviews.llvm.org/D63024





More information about the llvm-commits mailing list