<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 24, 2015, at 10:19 AM, Eli Bendersky <<a href="mailto:eliben@google.com" class="">eliben@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jun 24, 2015 at 7:05 AM, Q Z <span dir="ltr" class=""><<a href="mailto:zhaoqian301@gmail.com" target="_blank" class="">zhaoqian301@gmail.com</a>></span> wrote:<br class=""><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" class="">Hello,I want to compile a large project(for example,Apache httpd) to one .bc file. How can I do this? Can you give me some examples?<div class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">In general, if the codebase of a certain project is compilable by Clang/LLVM, this should be possible, but the devil is in the details (for example - how is the standard library going to get compiled into that .bc file?)</div></div></div></div></div></blockquote>If you only care about the project itself and not things like the standard library, then LTO is possible too. Depends on the linker you are using, but Apple’s ld and I believe the gold linker both have -save-temps options which save the bit codes before/after optimization but certainly after linking.</div><div><br class=""></div><div>Cheers,</div><div>Pete<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">I suggest you take a look at the "NaCl ports" project (<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__code.google.com_p_naclports_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=RfjvEJWweAkWHLneLw1ksvf1RoobZbEIUUVtXtJgYv4&s=RvO9OeVGsfCkE0U5HJQV_pwo1s2U1qoZg2Wx-gK19cs&e=" class="">https://code.google.com/p/naclports/</a>). It has ready-made makefiles to compile a bunch of well known open source projects using the PNaCl toolchain, which is based on LLVM. Each file is compiled to IR and the LLVM linker is used to link them all together. This is a full solution, handling the standard libraries, and so on. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Eli</div><div class=""><br class=""></div></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:LLVMdev@cs.uiuc.edu" class="">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" class="">http://llvm.cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class=""></div></blockquote></div><br class=""></body></html>