Skip to content

Instantly share code, notes, and snippets.

@karolba
Last active March 18, 2024 07:41
Show Gist options
  • Save karolba/d51e31889161bcf1be335fd970b12cc8 to your computer and use it in GitHub Desktop.
Save karolba/d51e31889161bcf1be335fd970b12cc8 to your computer and use it in GitHub Desktop.
(GNU/)Linux distributions and their minimum kernel versions supported by their libc

glibc-based systems

The minimum kernel version can be configured by passing in the --enable-kernel parameter to glibc's configure script.

  1. Arch Linux - Linux 4.4 (release year: 2016)
...
--enable-kernel=4.4
...

Source: https://gitlab.archlinux.org/archlinux/packaging/packages/glibc/-/blob/main/PKGBUILD#L55

  1. NixOS - Linux 3.10.0 (release year: 2013)
"--enable-kernel=3.10.0" # RHEL 7 and derivatives, seems oldest still supported kernel

Source: https://github.com/NixOS/nixpkgs/blob/8eef75145e6c3beada369aee48bd9c2c3a4dee88/pkgs/development/libraries/glibc/common.nix#L148

  1. Ubuntu - Linux 3.2 (release year: 2012)
...
MIN_KERNEL_SUPPORTED := 3.2
...
with_headers = ... --enable-kernel=$(call xx,MIN_KERNEL_SUPPORTED)
...

Source: https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/tree/debian/sysdeps/linux.mk#n4 (lines 4 and and 30)

  1. Debian - Linux 3.2 (release year: 2012)
...
MIN_KERNEL_SUPPORTED := 3.2
...
with_headers = ... --enable-kernel=$(call xx,MIN_KERNEL_SUPPORTED)
...

Source: https://salsa.debian.org/glibc-team/glibc/-/blob/sid/debian/sysdeps/linux.mk#L4 (lines 4 and 30)

  1. Red Hat - Linux 3.2 (release year: 2012)
...
%global enablekernel 3.2
...
EnableKernel="--enable-kernel=%{enablekernel}"
...
	--with-headers=%{_prefix}/include $EnableKernel \
...

Source: https://src.fedoraproject.org/rpms/glibc/blob/rawhide/f/glibc.spec#_318

  1. Gentoo - Linux 3.2 (relese year: 2012)
...
# Minimum kernel version that glibc requires
MIN_KERN_VER="3.2.0"
...
myconf+=( --enable-kernel=${MIN_KERN_VER} )
...

Source: https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/glibc/glibc-2.37-r3.ebuild#n33

  1. GNU Guix - Linux 3.2 (release year: 2012)
;; This is the default for most architectures as of GNU libc 2.26,
;; but we specify it explicitly for clarity and consistency.  See
;; "kernel-features.h" in the GNU libc for details.
"--enable-kernel=3.2.0"

Source: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/base.scm#n858

musl-based systems

The musl library seems to only require Linux >= 2.6.39 - althought it's not yet clear to me whether this is a run-time or a compile-time requirement.

musl is built on the Linux syscall layer. Linux kernel >=2.6.39 is necessary for POSIX conformant behaviour, older kernels will work with varying degrees of non-conformance, 2.4 kernels will only work for simple single-threaded applications.

Source: https://wiki.musl-libc.org/supported-platforms.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment