[llvmlinux] build and link .bc kernel

Cristian Zamfir cristian.zamfir at epfl.ch
Mon Nov 25 22:27:37 UTC 2013


Hi, I am new to the list. I just tried llvmlinux and it is really
exciting this project exists, great job!

My main goal is to get the .bc file corresponding to an x86_64 kernel.
I see that one can pass --emit-llvm (make BITCODE=1) to get .bc files
for each .o file, but I am wondering if anyone attempted to use the LD
gold plugin to link the entire kernel.  This would require (at least)
some changes to LDFLAGS (-flto -Wl,-plugin-opt=also-emit-llvm) and LD
gold.

I also experienced some problems building the kernel out of the box on
Ubuntu 12.04.

For instance:
  git clone http://git.linuxfoundation.org/llvmlinux.git
  cd llvmlinux/targets/x86_64_tiny
  make

fails with errors about failed patches, here is the log:
https://www.dropbox.com/sh/2n8i8rgp4lab5jh/9crVnAjGJi

I tried some other targets and eventually I could compile the
x86_64_tiny kernel, but not the x86_64 one. I then did make sync-all
and now patches fail again. Perhaps I should specify a stable
checkpoint parameter to the makefile, or am I doing something wrong?

Thank you,
Cristi


More information about the LLVMLinux mailing list