If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Moving Towards Building The Linux Kernel With Clang

11-04-2012, 08:00 AM

Phoronix: Moving Towards Building The Linux Kernel With Clang

While it hasn't been a news item for a couple months, a group of developers are still hard at work to advance the LLVM/Clang compiler and the Linux kernel to a point where this alternative compiler to GCC can be used for building the Linux kernel...

Comment

Yeah, but it would still be interesting to see how it affects things in general to have the kernel compiled this way (so i would sugest having the actual test be compiled with the same compiler for both test runs).

None of the "much faster" cases will affect the kernel in any way (they're all parts of highly specialized benchmarks that opt in to non-standard C/C++ extensions, e.g. OpenMP, rather than coding those features natively; Clang is gaining OpenMP), and many of the rest will also have small to little impact on the kernel (SIMD/auto-vectorization support, etc.).

Benchmarks of user-space programs that are themselves highly specialized really can't do more than vaguely hint at what the kernel compiled performance will be.

Apple refuses to use GPL v3 software, probably because of the patent provisions that would interfere with Apple's ability to sue every living organism in the universe.

After the license changed, Apple poured huge amounts of money into Clang. The rise of Clang is essentially Apple showing the FSF the middle finger. They built their entire product line on GCC, but didn't like the license change and now they are replacing it with their own compiler. The bonus is that they can close it whenever they want.

It's good to have more options, as long as they're standards-compliant. Clang will take over some of GCC's share on closed, proprietary systems (like MacOSX) and BSDs (because they prefer BSD-licensed software), but it will probably never endanger GCC on Linux.

Comment

The license thing is why Apple is pushing LLVM, certainly. But politics aside, LLVM has the benefit of being a younger project with a much cleaner architecture - the result being that it's much easier to extend, and to embed into other systems. In contrast, GCC is big and monolithic - it's almost impossible to re-use any piece of it. The GCC devs are trying to change that, but they've got decades worth of accumulated code that makes the job harder.

The effect of this is that LLVM-based tools are a lot more attractive to other projects. If you write an IDE, the only way to hook into GCC is to fork out and run the compiler binary, and parse the console output to read the error messages. Whereas Clang/LLVM can be used as a library - run it in-process, and deal with input and output through a decent API.

Comment

It embodies everything that is wrong with "free" software. From the idiotic bureaucracy of the steering committee to the horrible code documentation to the inability to address bugs in a timely manner to the rejection of bugfixes because of who wrote them.

It's a bloated steaming pile of stuff even without the idiocy of gpl zealots that left people with a choice, fork gcc (again) or start a new compiler from scratch.