[PATCH] D108985: [objcopy] Enable llvm options to be passed via $LLVM_OPTS

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 02:28:26 PDT 2021


sbc100 added a comment.

In D108985#2976307 <https://reviews.llvm.org/D108985#2976307>, @jhenderson wrote:

> Which LLVM options do you and need for what purposes?
>
> I've got no real issue with this change in principle, but I think this needs a wider discussion - it doesn't make sense to provide this mechanism in llvm-objcopy on its own, after all, as you've already noted.
>
> Some other thoughts:
>
> 1. If we do expand this to multiple tools, do we want all tools to share the same variable, or should we have separate variable names? Is it likely that users of multiple tools will want the variable set, but only for some tools?

Yes I think we should add this mechanism to all tool that don't currently call `ParseCommandLineOptions`.  I don't think there are too may such tools but its universally useful to be able to turn on debugging.

> 2. I'm assuming these options are internal options, and as such, I think "LLVM_OPTS" isn't a great name. Perhaps "LLVM_INTERNAL_OPTS" would be better?

I'm not sure what you mean by "internal" here.  In this case they are debug-only options.   This is a mechanism to passing any `cl::` options in the codebase.  Maybe the term "internal" applies, but I'm not sure what it mean here.

> 3. Maybe the options you want to use just want adding as new options in the list of objcopy options?

If I understand correctly that would involve adding extra logic duplicating the handling of `-debug` and `-debug-only` that already exists in `./llvm/lib/Support/Debug.cpp`?   If there was a way to re-using the existing option or forward them somehow it might work?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108985



More information about the llvm-commits mailing list