<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 1/6/16 9:41 AM, Kai Wang via
      llvm-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CACOsawFx9mXMoakM5WjaXg4+NT9bH9_SUEqfGTXo5vpF=iVENg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr"><br>
        <div>
          <div>Hi all,</div>
          <div><br>
          </div>
          <div>I'm trying to generate whole program bitcode files for
            linux kernel and do <span>interprocedural analysis on
              kernel.</span></div>
          <div><span><br>
            </span></div>
          <div><span>I use llvmlinux to compile kernel with clang and
               generate a bunch of bitcode files successfully.</span></div>
          <div><span>I need to link all these bitcode files together
              into a single bitcode file, so that I can run whole
              program analysis. </span></div>
          <div><span><br>
            </span></div>
          <div><span>Should I use l</span><span>ibLTO</span><span> to
              link all these bitcode files together? I guess I have to
              modify the linux kernel's build scripts and Makefiles?</span></div>
          <div>I'm kind of confused. Any suggestions?</div>
        </div>
      </div>
    </blockquote>
    <br>
    There are two ways to do it.<br>
    <br>
    First, you can use llvm-link to link the bitcode files together. 
    This will require some manual changes to the Linux Makefiles.  Once
    you get a single bitcode file, you can run your analysis pass via
    opt.  This is the approach that I used for the original SVA system
    for Linux 2.4.22 back before we had libLTO.<br>
    <br>
    Second, you could add your pass to libLTO and change the Linux
    Makefiles to use the -flto option.  This method should require fewer
    Makefile changes but will require you to build and install your own
    libLTO library.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <br>
    <blockquote
cite="mid:CACOsawFx9mXMoakM5WjaXg4+NT9bH9_SUEqfGTXo5vpF=iVENg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div><br>
          </div>
          <div>Thank you</div>
          <div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr">Regards,
              <div>Kai</div>
            </div>
          </div>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>