[llvm-dev] Shell auto-completion for ld.lld linker

Rui Ueyama via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 7 23:31:53 PDT 2019


Hi Shivam,

As to the process of how to add a new feature to lld, it is recommended to
start a new discussion thread at the llvm-dev mailing list, so thank you
for starting this new thread. It is fine to create a proof-of-concept
implementation, but I don't think you'd want to spend too much time on it
before you get an agreement that a proposed new feature looks like a good
one.

Speaking of the proposed feature, I have a couple of comments and questions
as follows:

 - Compilers have an extremely large number of command line options, and
the number is growing. Many features accessible via the command line can be
enabled/disabled at ./configure-time. Because of these facts, a static
command-line completion setting doesn't work well for compilers. But I
don't think that neither conditions are true to linkers; linkers don't have
large number of options, and new options are not added very frequently.
Most commands, like tar or ls, doesn't have a feature to support
command-line auto-comletion. What makes linkers special from other commands?

 - Can't the auto-completion script for GNU ld work for lld? As you said,
that may lack a few command options, but it should work in most cases, and
I'm not personally worried too much if an auto-completion is not very
precise.

 - Somewhat related to the previous point, but on some systems, lld is
installed as /usr/bin/ld. How do you distinguish it from GNU ld, or do we
really need to distinguish them?

 - Users are not expected to use a linker directly. Instead, they are
expected to invoke a linker using a compiler driver (i.e. clang or
clang++). Does your auto-completion work to autocomplete -Wl,-foo options
given to a compiler driver?

On Mon, Jul 8, 2019 at 2:44 PM shivam gupta <shivam98.tkg at gmail.com> wrote:

> Hi lld developers,
> As a GSoC student I wrote static ld.lld auto-completion scripts for zsh
> and bash shell because it doesn't have much options and flags for dynamic
> completion. Whether I send pr to zsh-completion/bash-completion package or
> open phabricator review for them? Also gnu ld has already autocompletion
> for bash shell but l am not merging ld and lld completion scripts to one
> file because lld lacks some options compare to ld and bash completion
> scripts only parse --help argument. Scripts are attached to the mail!
> Regards
> Shivam
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190708/373195fe/attachment.html>


More information about the llvm-dev mailing list