[LLVMdev] converting large projects to LLVM

Nick Lewycky nicholas at mxc.ca
Wed Oct 28 22:11:15 PDT 2009


dan mihai wrote:
>   Hi,
> 
> I wrote an interprocedural instrumentation pass that needs to run on all 
> program at once.
> However, when I try to test it on large programs (say bzip2 or gcc) I 
> find that the way LLVM
> tools do not easilly replace the default ones used in makefiles. So 
> building large projects is
> not straightforward. Is there a simple way to do this conversion?

No. The first step is to replace gcc with "llvm-gcc -flto", but the last 
stage of a build is usually a link against other libraries which you 
don't want to do.

You can't link bitcode with native code and produce bitcode, but you do 
want to link the bitcode together. Modify the Makefile to remove the 
existing linking step and write a new one that calls llvm-link or 
"llvm-ld -link-as-library" over the .o files.

Nick



More information about the llvm-dev mailing list