<div dir="ltr"><br><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 bgcolor="#FFFFFF" text="#000000">
    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>     </div></blockquote><div><br></div><div>When we first started investigating the feasibility of LTO on our target, in order to avoid having to change build systems, we replaced our linker executable with a python script that called llvm-link, opt, llc, and the original linker.  The only build system change required was to add -flto to the compiler command line options.  This worked surprisingly well as a first attempt.  Depending on how invasive the Makefiles changes would be, this method may be simpler for your purposes, although if you're able to use libLTO that would be simpler still.  Gao's lightning talk "<b style="color:rgb(0,0,0);font-family:-webkit-standard">Link-Time Optimization without Linker Support" </b>from the 2013 developer meeting goes into more detail of the approach: <a href="http://llvm.org/devmtg/2013-11/#light">http://llvm.org/devmtg/2013-11/#light</a></div><div><br></div><div>-Greg</div><div> </div></div></div></div>