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. Trying The Configurable 45 Watt TDP With AMD's A10-7800 / A6-7400K
  2. Sumo's Omni Gets Reloaded
  3. AMD A10-7800 & A6-7400K APUs Run Great On Linux
  4. Radeon Gallium3D Is Running Increasingly Well Against AMD's Catalyst Driver
Latest Linux Articles
  1. Intel Sandy Bridge Gets A Surprise Boost From Linux 3.17
  2. Open-Source Radeon Graphics Have Some Improvements On Linux 3.17
  3. CPUFreq Scaling Tests With AMD's Kaveri On Linux 3.16
  4. Enabling HyperZ Is Still An Easy Way For Faster RadeonSI Performance
Latest Linux News
  1. Userptr Support Set For AMD Radeon GPUs In Linux 3.18
  2. NVIDIA Releases CUDA 6.5 As A Huge Update
  3. GNOME 3.14 Beta Makes GLSL Optional, Supports Wayland Gesture/Touch Events
  4. KDE Software Compilation 4.14 Released
  5. The Many Things You Can Build With A Raspberry Pi
  6. AMD's Catalyst Linux Driver Preparing For A World Without An X Server?
  7. Khronos Publishes Its Slides About OpenGL-Next
  8. Proposed: A Tainted Performance State For The Linux Kernel
  9. Systemd 216 Piles On More Features, Aims For New User-Space VT
  10. LXQt 0.8 Is Being Released Soon
Latest Forum Discussions
  1. The dangers of Linux kernel development
  2. Remote gui not accessible in Phoronix Test Suite 5.2
  3. Dead Island for Linux (?)
  4. Updated and Optimized Ubuntu Free Graphics Drivers
  5. AMD Offers Mantle For OpenGL-Next, Pushes Mantle To Workstations
  6. Next-Gen OpenGL To Be Announced Next Month
  7. OpenGL 4.5 Released With New Features
  8. Updated graphics drivers for Ubuntu 12.04 Precise LTS