[LLVMdev] how to compile a large project to LLVM IR?

Eli Bendersky
Wed, 24 Jun 2015 17:19:20 -0000

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>