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. Intel Launches The Core i7 5960X, Mighty Powerful Haswell-E CPUs
  2. AMD Radeon R9 290: Gallium3D vs. Catalyst Drivers
  3. AMD Radeon R9 290 Open-Source Driver Works, But Has A Ways To Go
  4. Trying The Configurable 45 Watt TDP With AMD's A10-7800 / A6-7400K
Latest Linux Articles
  1. How Intel Graphics On Linux Compare To Open-Source AMD/NVIDIA Drivers
  2. The Fastest NVIDIA GPUs For Open-Source Nouveau With Steam Linux Gaming
  3. Testing For The Latest Linux Kernel Power Regression
  4. The Most Energy Efficient Radeon GPU For AMD Linux Gaming
Latest Linux News
  1. Nouveau X.Org Driver Released With DRI3+Present, Maxwell, GLAMOR
  2. Microsoft & AMD Release C++ AMP Compiler With Linux Support
  3. AMD, Wine & Valve Dominated August For Linux Users
  4. Linux 3.17-rc3 Kernel Released Back On Schedule
  5. Lennart Poettering Talks Up His New Linux Vision That Involves Btrfs
  6. Mesa 10.3 RC2 Arrives Via Its New Release Manager
  7. Ubuntu 14.10's Lack Of X.Org Server 1.16 Gets Blamed On AMD
  8. MSI Motherboard BIOS Updating Remains A Pain For Linux Users
  9. See How Your Linux System Performs Against The Latest Intel/AMD CPUs
  10. AMD Steppe Eagle Flys To Coreboot
Latest Forum Discussions
  1. Lennart Poettering Talks Up His New Linux Vision That Involves Btrfs
  2. SSD seems slow
  3. AMD Releases UVD Video Decode Support For R600 GPUs
  4. Is laptop with Intel CPU and AMD dGPU worth buying considering especially AMD Enduro?
  5. Radeon HD5670 and Ubuntu 14.04
  6. Btrfs Gets Talked Up, Googler Encourages You To Try Btrfs
  7. Updated graphics drivers for Ubuntu 12.04 Precise LTS
  8. Catalyst 14.201.1008