[llvmlinux] build and link .bc kernel

Behan Webster behanw at converseincode.com
Mon Nov 25 23:18:17 UTC 2013


On 11/25/13 15:00, Ghitulete Razvan wrote:
> Hi Cristi,
>
> I've actually been working on this or some time now. You cannot
> actually compile the Linux kernel out of the box with the -flto flag.
> Andi Kleen has been working on getting the kernel to compile with flto
> on gcc, but his patches have not been merged in the mainstream. His
> repository is at [1]. And it should compile with GCC with no problems
> at all.
>
> You can tweak the llvmlinux makefile and replace the mainstream Linux
> repo with that one. There are also some more additional challenges
> along the way with modifying the kernel scripts to acknowledge .bc
> files instead of ELF. It also depends whether you want to have the
> vmlinux in .bc format or just individual modules. For the latter you
> should be able to do so by also replacing ld with the gold linker. I
> am still looking into how to get a vmlinux.bc file (that will also
> boot :) )
Certainly if someone wants to build a new LLVMLinux target to support
testing with gold, I'd be happy to merge the code into our git repo.

The same with contributed checkpoints (which I should have said in the
previous email). I will merge those too if you feel they will help others.

Behan

-- 
Behan Webster
behanw at converseincode.com



More information about the LLVMLinux mailing list