Page MenuHomePhabricator

[llvm-ar] Allow MRI scripts to be passed via command line argument

Authored by gbreynoo on Oct 23 2019, 8:41 AM.



Some of our customers prefer the input of MRI scripts through command line argument rather than through stdin. I've set up this diff to see if there was interest in this functionality, allowing for either method to be used.

For context:

  • gnu-ar only allows use of MRI scripts through stdin.
  • -M is the only command in gnu-ar or llvm-ar that requires use of stdin.

Diff Detail

Event Timeline

gbreynoo created this revision.Oct 23 2019, 8:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2019, 8:41 AM
ruiu added a comment.Oct 23 2019, 9:51 AM

Honestly I'd try to avoid adding a new command line option to llvm-ar. Especially, in this case there are several easy workaround as follows:

  • instead of passing contents of MRI script as an external file you can use shell redirection
  • if shell is not available or for some reason you don't want to use it, you can write a wrapper that passes an MRI script to llvm-ar

Also, adding an incompatible new feature to llvm-ar will hurt the interoperability with other ar commands. Once you add a new feature and depend on it, you can't go back to the other ar commands.

Compared to the above points, the benefit of doing this is not very clear to me. If you have more contexts, could you elaborate?

gbreynoo abandoned this revision.Oct 24 2019, 5:52 AM

Rui makes good points that I struggle to argue with. I'll abandon this review as their is no interest.