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? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150624/105789c4/attachment.html>
On Wed, Jun 24, 2015 at 7:05 AM, Q Z <zhaoqian301 at gmail.com> wrote:> 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? > >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?) I suggest you take a look at the "NaCl ports" project ( https://code.google.com/p/naclports/). 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. Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150624/cbc33a13/attachment.html>
> On Jun 24, 2015, at 10:19 AM, Eli Bendersky <eliben at google.com> wrote: > > > > On Wed, Jun 24, 2015 at 7:05 AM, Q Z <zhaoqian301 at gmail.com <mailto:zhaoqian301 at gmail.com>> wrote: > 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? > > > 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?)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. Cheers, Pete> > I suggest you take a look at the "NaCl ports" project (https://code.google.com/p/naclports/ <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=>). 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. > > > Eli > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150624/abd0bc27/attachment.html>
You can probably generate different .bc files and link/merge them using llvm-link. http://llvm.org/releases/2.7/docs/CommandGuide/html/llvm-link.html Regards, Ashutosh From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Q Z Sent: Wednesday, June 24, 2015 7:36 PM To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] how to compile a large project to LLVM IR? 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? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150625/897d0b69/attachment.html>
Possibly Parallel Threads
- [LLVMdev] how to compile a large project to LLVM IR?
- [LLVMdev] static taint analysis in LLVM
- [LLVMdev] [RFC]Extending lib/Linker to support bitcode "shared objects"
- [LLVMdev] a question about pooalloc
- [LLVMdev] [RFC]Extending lib/Linker to support bitcode "shared objects"