[PATCH] D110904: [lld-macho] Check for errors when the response file doesn't exist.

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 4 10:27:09 PDT 2021


oontvoo added a comment.

In D110904#3040045 <https://reviews.llvm.org/D110904#3040045>, @thakis wrote:

>> Hmm which version printed this?
>
> Trunk. (I did pass a -arch flag though.)
>
>> ELF seems to have it:
>
> Can you check how it does it? It can't call that function that doesn't yet exist :)
>
> (I guess we error out due to missing `-arch` before trying to open "@foo" as input file in MachO, which is why the -arch error is printed before the rsp error. Almost all users will use lld through the clang driver though, so in practice `-arch` will always be present.)

Oh, I see what you're saying. Right, ELF doesn't explicitly check for the response file not found, either. Instead it'd just try to load it as an input file later if it's previously fail to expand the `@foo.txt` .

IMO, that's a bit confusing - the `cl::ExpandResponseFiles()` today already returns a bool flag to indicate whether it succeeded - callers should probably check it. (Neither macho nor elf does that today). My other patch only expand the `ExpandResponseFiles` only expands the function to include more error info ...

Happy to apply the same change here over to elf (probably in a separate patch tho).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110904



More information about the llvm-commits mailing list