[LLVMdev] compile linux kernel

Andrew Lenharth andrewl at lenharth.org
Mon Sep 29 06:25:19 PDT 2008


On Sun, Sep 28, 2008 at 12:07 AM, Ashish Bijlani
<ashish.bijlani at gmail.com> wrote:
> does that mean .o generated with  gcc (.c -> .s and .s -> .o) will not
> contain llvm ir?

The kernel uses .c -> .s steps to build target dependent asm including
things such as struct offsets.  The kernel has some .s files (often
including the ones generated from .c files) that are target dependent.

Finally simple things such as interrupt controllers and clocks and io
architecture and mmu control are all target independent.

> i meant, final kernel bitcode ir arch independent and can be JIT with
> any arch-specific backend. Is it not the case?

The SVA project (http://sva.cs.uiuc.edu/SVA_files/page0002.html see
top two papers) made inroads on this with significant extensions to
the instruction set to virtualize many hardware elements the OS must
deal with.

Andrew

> thanks,
> ashish
>
> On Sat, Sep 27, 2008 at 10:43 PM, Andrew Lenharth <andrewl at lenharth.org> wrote:
>> On Sat, Sep 27, 2008 at 8:08 PM, Ashish Bijlani
>> <ashish.bijlani at gmail.com> wrote:
>>> If I use GCC to generate asm-offsets.s file, then the build system go
>>> ahead but fails when it generates .so files as Andrew pointed out.
>>
>> You have to generate this with gcc.  .c -> .s and .s -> .o need gcc,
>> .c -> .o can use llvm-gcc.  The combination has to be fixed up in
>> final linking.
>>
>>> Now, If the build systems generates .so files, then it will be
>>> difficult o actually generate fully arch-independent kernel code,
>>> isn't it?
>>
>> A llvm compiled kernel is in no way arch-independent.  It is very very
>> arch dependent.
>>
>> Andrew
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



More information about the llvm-dev mailing list