Ringing In 2020 By Clang'ing The Linux 5.5 Kernel - Benchmarks Of GCC vs. Clang Built Kernels

Written by Michael Larabel in Software on 31 December 2019 at 11:00 AM EST.

One of the interesting milestones this year in the compiler world was the ability with LLVM Clang 9.0 to compile Linux 5.3+ for x86_64 without needing any extra patches to either the kernel or the LLVM/Clang compiler. That initial support in Linux 5.3 was not without a few issues, but on Linux 5.5 the experience is in great shape with the stable Clang compiler.

The main issue encountered when Clang'ing Linux 5.3 was the AMDGPU driver running into build problems. Fortunately, that was since resolved and with Linux 5.5 tests I recently did when building the kernel with Clang 9.0, the AMDGPU driver has worked out fine. With that resolved and no new Clang kernel compatibility problems introduced, it was a pleasant experience building Linux 5.5 with Clang simply by adjusting the CC environment variable.

On the AMD Ryzen Threadripper 3970X workstation, I recent carried out benchmarks when Linux 5.5-rc3 was built with the Clang 9.0 compiler and then again when the same kernel with the same sources and Kconfig were built using GCC 9.2.1. Ubuntu 19.10 was running on this 32-core / 64-thread high-end system. No other changes were made to the system besides switching out the kernel built under each compiler.

Related Articles