1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems

Facebook RSS Twitter Twitter Google Plus

Phoronix Test Suite


Building The Linux Kernel With LLVM's Clang Yields Comparable Performance

Michael Larabel

Published on 30 May 2014
Written by Michael Larabel
Page 1 of 3 - 25 Comments

With the upstream Linux kernel nearly compatible with LLVM's Clang compiler as an alternative to using GCC, I benchmarked the latest "LLVMLinux" code that's the Linux kernel compiled under Clang with some out-of-tree patches to see how its performance compares to a conventionally built kernel with GCC 4.8.

On an ASUS Zenbook Prime (UX32VDA) ultrabook I used the latest LLVMLinux code as of 26 May to build a 64-bit (x86_64) kernel using the LLVM/Clang 3.5 state it uses by default and was for the Linux 3.14 kernel target. After building and testing this Clang-compiled kernel, I then compared its performance to a Linux 3.14.0 vanilla kernel compiled by the GCC 4.8.2 compiler and using the same config settings. The same host compiler (GCC 4.8.2) was used when building the actual tests and the only changed factor was whether the Linux 3.14.0 kernel image was built using LLVMLinux with Clang or the upstream sources with GCC 4.8.2.

The LLVMLinux build process overall went smooth, aside from a few hiccups. The v3.14 kernel build originally failed due to a series file not being present within the Linux 3.14 kernel patches directory, but after making up my own replacement file with the patch file names, that worked. When it came to installing the kernel, the documentation cites installing from the src/ directory but with the latest LLVMLinux state for x86_64 it's actually within the build/ directory. The general build instructions for a Clang-compiled LLVMLinux kernel can be found via the project's Wiki.

Hopefully with the upcoming Linux 3.16 kernel we will see the upstream code even closer to being able to be built under the LLVM Clang compiler over GCC. All of our initial benchmarking for this article was done using the Phoronix Test Suite, of course.

We have covered the LLVMLinux project many times with an increasing number of developers from the x86 and ARM world being interested in building the kernel with Clang. Among the reasons for wanting to build the Linux kernel with Clang is for possible performance advantages, faster kernel compilation times when debugging the kernel, using Clang's static analysis abilities on the kernel code itself, improving the quality of LLVM and Clang by finding missing/broken compiler features, and improving the overall code quality of the Linux kernel by making the code compatible with more compilers.

<< Previous Page
Latest Linux Hardware Reviews
  1. The Power Consumption & Efficiency Of Open-Source GPU Drivers
  2. AMD R600g/RadeonSI Performance On Linux 3.16 With Mesa 10.3-devel
  3. Intel Pentium G3258 On Linux
  4. SilverStone Precision PS10
Latest Linux Articles
  1. Nouveau vs. Radeon vs. Intel Tests On Linux 3.16, Mesa 10.3-devel
  2. KVM Benchmarks On Ubuntu 14.10
  3. X.Org Server 1.16 Officially Released With Terrific Features
  4. Ubuntu With Linux 3.16 Smashes OS X 10.9.4 On The MacBook Air
Latest Linux News
  1. Linus Torvalds On GCC 4.9: Pure & Utter Crap
  2. Cauldron 2014: GCC & LLVM Will Look To Collaborate More
  3. GCC Receives ACM Programming Languages Software Award
  4. KDE 4.14 Beta 3 Released
  5. A New Video Has Us Real Excited About The New UT For Linux
  6. CoreOS Experiences Its First Stable Release
  7. GNOME 3.13.4 Continues Working On Wayland & More
  8. Wine 1.7.23 Has Initial Support For 64-bit Android Builds
  9. FreeBSD Developing A New Automounter, Other Features
  10. Guix 0.7 Can Now Install The GNU Operating System
Latest Forum Discussions
  1. Updated and Optimized Ubuntu Free Graphics Drivers
  2. Debian + radeonsi
  3. How To Setup Radeon DPM On Ubuntu Linux
  4. Open-source drivers on ATI R7 260X
  5. New build, first Linux PC, what could go wrong? ;)
  6. AMD "Hawaii" Open-Source GPU Acceleration Still Not Working Right
  7. Radeon related kernel bug??
  8. how the US intellegentia operates: