From 68b44c86c202e2e7c88573da9832fa981167db7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 10 Nov 2022 17:19:25 +0100 Subject: [PATCH] glibc: bump the minimum kernel version I don't think anyone sane is really using kernel < 3.10 nowadays. (At least in a use case with glibc from nixpkgs.) As another suspect with old kernels, Ubuntu seems to start at 3.13 now. --- .../libraries/glibc/allow-kernel-2.6.32.patch | 39 ------------------- pkgs/development/libraries/glibc/common.nix | 32 +-------------- 2 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch diff --git a/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch b/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch deleted file mode 100644 index ce18b874c4272..0000000000000 --- a/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure -index cace758c01..38fe7fe0b0 100644 ---- a/sysdeps/unix/sysv/linux/configure -+++ b/sysdeps/unix/sysv/linux/configure -@@ -69,7 +69,7 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5 - $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; } - decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`; --abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`; -+abinum=`echo "2.6.32.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`; - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac -index 13abda0a51..6abc12eaed 100644 ---- a/sysdeps/unix/sysv/linux/configure.ac -+++ b/sysdeps/unix/sysv/linux/configure.ac -@@ -50,7 +50,7 @@ fi - AC_MSG_CHECKING(for kernel header at least $minimum_kernel) - changequote(,)dnl - decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`; --abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`; -+abinum=`echo "2.6.32.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`; - changequote([,])dnl - AC_TRY_COMPILE([#include - #if LINUX_VERSION_CODE < $decnum -diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h -index 823cd8224d..482caaeeec 100644 ---- a/sysdeps/unix/sysv/linux/dl-osinfo.h -+++ b/sysdeps/unix/sysv/linux/dl-osinfo.h -@@ -39,7 +39,7 @@ - GLRO(dl_osversion) = version; \ - \ - /* Now we can test with the required version. */ \ -- if (__LINUX_KERNEL_VERSION > 0 && version < __LINUX_KERNEL_VERSION) \ -+ if (__LINUX_KERNEL_VERSION > 0 && version < __LINUX_KERNEL_VERSION && version != 0x020620) \ - /* Not sufficent. */ \ - FATAL ("FATAL: kernel too old\n"); \ - } \ diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 83cde07749496..3267f9203f1b0 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -86,36 +86,6 @@ stdenv.mkDerivation ({ patch extends the search path by "/run/current-system/sw/bin". */ ./fix_path_attribute_in_getconf.patch - /* Allow running with RHEL 6 -like kernels. The patch adds an exception - for glibc to accept 2.6.32 and to tag the ELFs as 2.6.32-compatible - (otherwise the loader would refuse libc). - Note that glibc will fully work only on their heavily patched kernels - and we lose early mismatch detection on 2.6.32. - - On major glibc updates we should check that the patched kernel supports - all the required features. ATM it's verified up to glibc-2.26-131. - # HOWTO: check glibc sources for changes in kernel requirements - git log -p glibc-2.25.. sysdeps/unix/sysv/linux/x86_64/kernel-features.h sysdeps/unix/sysv/linux/kernel-features.h - # get kernel sources (update the URL) - mkdir tmp && cd tmp - curl http://vault.centos.org/6.9/os/Source/SPackages/kernel-2.6.32-696.el6.src.rpm | rpm2cpio - | cpio -idmv - tar xf linux-*.bz2 - # check syscall presence, for example - less linux-*?/arch/x86/kernel/syscall_table_32.S - */ - ./allow-kernel-2.6.32.patch - - /* Provide a fallback for missing prlimit64 syscall on RHEL 6 -like - kernels. - - This patch is maintained by @veprbl. If it gives you trouble, feel - free to ping me, I'd be happy to help. - */ - (fetchurl { - url = "https://git.savannah.gnu.org/cgit/guix.git/plain/gnu/packages/patches/glibc-reinstate-prlimit64-fallback.patch?id=eab07e78b691ae7866267fc04d31c7c3ad6b0eeb"; - sha256 = "091bk3kyrx1gc380gryrxjzgcmh1ajcj8s2rjhp2d2yzd5mpd5ps"; - }) - ./fix-x64-abi.patch /* https://github.com/NixOS/nixpkgs/pull/137601 */ @@ -172,7 +142,7 @@ stdenv.mkDerivation ({ # Enable Intel Control-flow Enforcement Technology (CET) support "--enable-cet" ] ++ lib.optionals withLinuxHeaders [ - "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26 + "--enable-kernel=3.10.0" # RHEL 7 and derivatives, seems oldest still supported kernel ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ (lib.flip lib.withFeature "fp" (stdenv.hostPlatform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"))