<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Jan 7, 2016 at 7:18 AM Rui Ueyama via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</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"><div class="gmail_extra">On Thu, Jan 7, 2016 at 7:03 AM, Arseny Kapoulkine via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">In the process of migrating from old lld ELF linker to new (previously ELF2) I noticed the interface lost several important features (ordered by importance for my use case):<div><br></div><div><div>1. Detecting errors in the first place. New linker seems to call exit(1) for any error.</div></div><div><br></div><div>2. Reporting messages to non-stderr outputs. Previously all link functions had a raw_ostream argument so it was possible to delay the error output, aggregate it for multiple linked files, output via a different format, etc.</div><div><br></div><div>3. Linking multiple outputs in parallel (useful for test drivers) in a single process. Not really an interface issue but there are at least two global pointers (Config & Driver) that refer to stack variables and are used in various places in the code.</div><div><br></div><div>All of this seems to indicate a departure from the linker being useable as a library. To maintain the previous behavior you'd have to use a linker binary & popen.</div><div><br></div><div>Is this a conscious design decision or a temporary limitation?</div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>That the new ELF and COFF linkers are designed as commands instead of libraries is very much an intended design change.</div></div></div></div></blockquote><div><br></div><div>I disagree.</div><div><br></div><div>During the discussion, there was a *specific* discussion of both the new COFF port and ELF port continuing to be libraries with a common command line driver.</div><div><br></div><div>If you want to consider changing that, we should have a fresh (and broad) discussion, but it goes pretty firmly against the design of the entire LLVM project. I also don't really understand why it would be beneficial.</div></div></div>