<div dir="auto"><div dir="ltr"><div dir="auto"><div>Hi Rui,<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 8, 2019, 12:02 PM Rui Ueyama <<a href="mailto:ruiu@google.com" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">ruiu@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Shivam,<div><br></div><div>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.</div><div><br></div><div>Speaking of the proposed feature, I have a couple of comments and questions as follows:</div><div><br></div><div> - 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?</div><div></div></div></blockquote></div></div><div dir="auto">Now these commands got auto-completion for both <a href="https://github.com/zsh-users/zsh/tree/master/Completion/Unix/Command" rel="noreferrer noreferrer" target="_blank">zsh</a> and <a href="https://github.com/scop/bash-completion/tree/master/completions" rel="noreferrer noreferrer" target="_blank">bash</a> shell.So I think we can also write auto-completion for lld as it has more options than them.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div> - 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.</div></div></blockquote></div></div><div dir="auto">Yeah! we can do something like <a href="https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_gcc" rel="noreferrer noreferrer" target="_blank">gcc</a> is doing for clang in zsh-completion package but we are also working to have separate auto-completion for clang using --autocomplete api. Also in bash shell when I parse --help option for completion, gnu ld gives 185 and ld.lld gives 204 possibilities in which these <a href="https://docs.google.com/document/d/1kEiK0TlXyZ58OU8O_8ikQYnCUIR3xC1n5I1UCAPNOTI/edit?usp=sharing" rel="noreferrer noreferrer" target="_blank">options</a> are different from each other so there is a big gap between them and getting wrong auto-completion is not good to have.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div> - 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?</div></div></blockquote></div></div><div dir="auto"> I think you're talking about FreeBSD or symlink to ld. For them it doesn't need to be distinguished though, it can be distinguished if we read binary. <br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div> - 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?</div></div></blockquote></div></div><div dir="auto">No,Current implementation of --autocomplete api is not completing linker options but we are also going to make some improvements in clang --autocomplete interface in next few weeks once lld completion is landed.</div><div dir="auto"><br></div><div>Regards,</div><div>Shivam<br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 8, 2019 at 2:44 PM shivam gupta <<a href="mailto:shivam98.tkg@gmail.com" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">shivam98.tkg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hi lld developers,<div dir="auto"><div dir="auto">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!</div><div dir="auto">Regards</div><div dir="auto">Shivam</div></div></div>
</blockquote></div>
</blockquote></div></div></div>
</div></div>