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

OpenBenchmarking.org

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
1
Latest Linux Hardware Reviews
  1. Even With Re-Clocking, Nouveau Remains Behind NVIDIA's Proprietary Linux Driver
  2. The Power Consumption & Efficiency Of Open-Source GPU Drivers
  3. AMD R600g/RadeonSI Performance On Linux 3.16 With Mesa 10.3-devel
  4. Intel Pentium G3258 On Linux
Latest Linux Articles
  1. AMD Catalyst 14.6 Does Slightly Better With APITest OpenGL Tests
  2. Updated Source Engine Benchmarks On The Latest AMD/NVIDIA Linux Drivers
  3. Nouveau vs. Radeon vs. Intel Tests On Linux 3.16, Mesa 10.3-devel
  4. KVM Benchmarks On Ubuntu 14.10
Latest Linux News
  1. Fedora Assembles A Security Team
  2. AMD Launches The A10-7800, The 65 Watt Kaveri
  3. Builder: A New Development IDE Being Built For GNOME
  4. GDB 7.8 Betters Python Scripting, Adds Guile Support
  5. GNOME's GTK+ Is Still Striving For A Scene Graph, Canvas API
  6. Unreal Tournament Looks Great For Team Deathmatch
  7. LibreOffice 4.3 Released With Many Exciting Changes
  8. GNOME/GTK On Wayland Gains Focus At GUADEC
  9. GNOME Stakeholders Take Issue With Groupon Over their Gnome
  10. GStreamer VA-API Plug-In Update Adds New Features
Latest Forum Discussions
  1. Grand Theft Auto Running On Direct3D Natively On Linux Shows Gallium3D Potential
  2. AMD Publishes Open-Source Linux HSA Kernel Driver
  3. Linus Torvalds On GCC 4.9: Pure & Utter Crap
  4. Debian + radeonsi
  5. Open-source drivers on ATI R7 260X
  6. AMD Athlon 5350 APU On Linux
  7. Updated and Optimized Ubuntu Free Graphics Drivers
  8. List of Linux friendly Kickstarter projects