LWN.net Logo

Distributions looking at LLVM

Distributions looking at LLVM

Posted Mar 23, 2012 23:31 UTC (Fri) by PaXTeam (subscriber, #24616)
Parent article: Distributions looking at LLVM

> Jeff Garzik said that he has been working on it, but "LLVM still needs
> several obscure compiler changes before we can even boot a no-op kernel".

i don't know what he's been doing, but i've been compiling linux with clang for almost 2 years now and since clang v3.0+few commits it can be done without any clang/llvm patches, only the linux side needs patching.


(Log in to post comments)

Distributions looking at LLVM

Posted Mar 23, 2012 23:43 UTC (Fri) by mstefani (subscriber, #31644) [Link]

I think he tries to use it with sparse as the front-end.

Distributions looking at LLVM

Posted Mar 24, 2012 8:41 UTC (Sat) by PaXTeam (subscriber, #24616) [Link]

but that means that the actual code optimization/generation part (llvm) is the same between clang and his sparse based work, so if the former can produce a working kernel (and has been able to do so for quite some time now) then his tool should be able to as well. sure, there're some gcc/gas features that clang/llvm don't have yet but they can be patched around on the linux side (my diff is about 60kB, 60 files changed, 258 insertions(+), 213 deletions(-)).

Distributions looking at LLVM

Posted Mar 24, 2012 18:54 UTC (Sat) by rahulsundaram (subscriber, #21946) [Link]

Instead of speculating, you can just send a email and coordinate.

Distributions looking at LLVM

Posted Mar 24, 2012 21:45 UTC (Sat) by PaXTeam (subscriber, #24616) [Link]

err, i'm not interested in sparse ;).

Distributions looking at LLVM

Posted Mar 25, 2012 1:09 UTC (Sun) by rahulsundaram (subscriber, #21946) [Link]

You were wondering what he was doing in your first comment in this thread. So I assumed you were interested in the answer.

Distributions looking at LLVM

Posted Mar 25, 2012 15:12 UTC (Sun) by PaXTeam (subscriber, #24616) [Link]

does rhetorical question mean anything to you? :P obviously if clang/llvm work fine (for me) then the problems must be somewhere else. now that it turned out to be the sparse/llvm interface, i consider the matter settled.

Distributions looking at LLVM

Posted Mar 25, 2012 20:28 UTC (Sun) by rgmoore (subscriber, #75) [Link]

That may represent a difference in emphasis. If your main goal is to get the compile working, you may be willing to patch whatever gets you there with the least effort, whether it's the compiler or the kernel source. But if your main interest is in improving the compiler so it can compile anything that GCC can, you have to stick with a vanilla kernel source and keep patching the compiler until it works.

Distributions looking at LLVM

Posted Mar 25, 2012 22:53 UTC (Sun) by PaXTeam (subscriber, #24616) [Link]

> But if your main interest is in improving the compiler so it can compile anything that GCC can[...]

clang developers do not want to achieve this, see http://clang.llvm.org/compatibility.html and http://clang.llvm.org/docs/UsersManual.html for some of the details (linux gets bitten by VLAs in structures and nested functions, among others).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds