[llvm-dev] whole linux kernel bitcode

John Criswell via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 6 07:53:29 PST 2016


On 1/6/16 9:41 AM, Kai Wang via llvm-dev wrote:
>
> Hi all,
>
> I'm trying to generate whole program bitcode files for linux kernel 
> and do interprocedural analysis on kernel.
>
> I use llvmlinux to compile kernel with clang and  generate a bunch of 
> bitcode files successfully.
> I need to link all these bitcode files together into a single bitcode 
> file, so that I can run whole program analysis.
>
> Should I use libLTO to link all these bitcode files together? I guess 
> I have to modify the linux kernel's build scripts and Makefiles?
> I'm kind of confused. Any suggestions?

There are two ways to do it.

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.

Second, you could add your pass to libLTO and change the Linux Makefiles 
to use the -flto option.  This method should require fewer Makefile 
changes but will require you to build and install your own libLTO library.

Regards,

John Criswell


>
> Thank you
>
> Regards,
> Kai
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160106/b6d89d60/attachment.html>


More information about the llvm-dev mailing list