<div dir="ltr"><div><div><div><div><div><div>> What is your ld version?<br></div>I've used ld 2.23.1 from MinGW package for my tests. This is quite old version. As far as I remember the gold-plugin is not supported on Windows for now. <br></div><br>As for linker, I need following features:<br></div>-ability to build windows dll<br></div>-ability to embed debug info compatible to gdb<br></div>-own crt (like MinGW has)  <br><br><br></div><div>I'm going to try lld with MinGW crt again (my recent attempts failed for some reason)<br></div><div><div><div><br><div><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-17 17:29 GMT+03:00 Teresa Johnson <span dir="ltr"><<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-m_8038837688793328135gmail-">On Thu, Nov 17, 2016 at 1:37 AM, Aliaksei Zasenka 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><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Hi John,<br>Thanks for your answer. <br></div><br>The CallGraph pass did the work for me. But since I actually have several modules and my toolchain looked like <br><br></div>llvm-link<br><div><div><CallGraph extraction pass><br>opt<br>llc<br><br> I've found that llvm-lto is great for doing all the work: greedy linkage, optimization and further MC generation. <br>Here the command line I'm using for that:<br>llvm-lto -exported-symbol=main -save-merged-module -filetype=asm <or obj> -o %t2 %t1<br>(I've attached corresponding llvm-lit test.)<br><br></div><div>Now I'm wondering if there is any possibility to use LTO within the linker like ld (mingw) to build a dynamic library from my IR code?<br></div></div></div></blockquote><div><br></div></span><div>What is your ld version? The Gold ld can invoke LLVM's gold-plugin when given bitcode input files, which will perform LTO. However, while the GNU ld recently gained the ability to invoke LLVM's gold-plugin to do this for bitcode, it is not a configuration we test, so I'd recommend Gold ld. Also, LLVM's lld has support for bitcode inputs and will also invoke LTO. For the gold plugin, see <a href="http://llvm.org/docs/GoldPlugin.html" target="_blank">http://llvm.org/docs/GoldP<wbr>lugin.html</a> for ensuring it is configured properly.<br></div><div><br></div><div>Teresa</div><div><div class="gmail-m_8038837688793328135gmail-h5"><div><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="ltr"><div><div></div><div><br></div><div>Best regards,<br></div><div>Alexey Zasenko<br></div><div><br></div><div></div></div></div><div class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-HOEnZb"><div class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-10-28 16:33 GMT+03:00 John Criswell <span dir="ltr"><<a href="mailto:jtcriswel@gmail.com" target="_blank">jtcriswel@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF"><span>
    <div class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503m_-7698986923138529790moz-cite-prefix">On 10/27/16 11:18 AM, Aliaksei Zasenka
      via llvm-dev wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div>
          <div>
            <div>Hi all,<br>
            </div>
            Can anyone give me advice about an appropriate way for
            extracting number of functions from module recursively
            (starting from entry point). Actually it may be more than
            one entry point so all dependent functions and global values
            must be extracted. <br>
            <br>
            I've tried llvm-extract tool but it can't do work
            recursively. Maybe it would be good to write some Call Graph
            pass or something. Any thoughts?<br>
          </div>
        </div>
      </div>
    </blockquote>
    <br></span>
    I thought llvm-extract conservatively extracted anything that was
    relevant to what it was asked to extract.<br>
    <br>
    In any event, if you need a call graph analysis, there are two call
    graph passes available for LLVM.<br>
    <br>
    The first is the CallGraph pass that comes in the LLVM source tree. 
    It is very conservative with function pointers, but its results are
    conservatively correct.<br>
    <br>
    The second is the CallGraph analysis within DSA.  You should be able
    to find a copy for LLVM 3.7 or LLVM 3.8 here
    (<a class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503m_-7698986923138529790moz-txt-link-freetext" href="https://github.com/jtcriswell/safecode-llvm37" target="_blank">https://github.com/jtcriswell<wbr>/safecode-llvm37</a>) and here
    (<a class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503m_-7698986923138529790moz-txt-link-freetext" href="https://github.com/jtcriswell/llvm-dsa" target="_blank">https://github.com/jtcriswell<wbr>/llvm-dsa</a>).<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <blockquote type="cite"><span>
      <div dir="ltr">
        <div>
          <div><br>
          </div>
          <div><br>
          </div>
          Thanks in advance,<br>
        </div>
        Alexey Zasenko<br>
      </div>
      <br>
      <fieldset class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503m_-7698986923138529790mimeAttachmentHeader"></fieldset>
      <br>
      </span><pre>______________________________<wbr>_________________
LLVM Developers mailing list
<a class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503m_-7698986923138529790moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503m_-7698986923138529790moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><span class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503HOEnZb"><font color="#888888">
</font></span></pre><span class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503HOEnZb"><font color="#888888">
    <br>
    <p><br>
    </p>
    <pre class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503m_-7698986923138529790moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail-m_4552484985686156503m_-7698986923138529790moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell" target="_blank">http://www.cs.rochester.edu/u/<wbr>criswell</a></pre>
  </font></span></div>

</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div></div></div><span class="gmail-m_8038837688793328135gmail-HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="gmail-m_8038837688793328135gmail-m_-8816396119930142264gmail_signature"><span style="font-family:times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td style="border-top:2px solid rgb(213,15,37)" nowrap>Teresa Johnson |</td><td style="border-top:2px solid rgb(51,105,232)" nowrap> Software Engineer |</td><td style="border-top:2px solid rgb(0,153,57)" nowrap> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td style="border-top:2px solid rgb(238,178,17)" nowrap> <a href="tel:408-460-2413" value="+14084602413" target="_blank">408-460-2413</a></td></tr></tbody></table></span></div>
</font></span></div></div>
</blockquote></div><br></div></div></div></div></div></div></div></div></div></div></div>