From 6740593bdd1738aa9771990f88655becc4dc343e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 24 Feb 2020 10:32:47 -0500 Subject: glibc: provide fallback for kernels with missing prlimit64 The current version of glibc implements support for kernels down to 3.2.0 (and we make sure to enable such support with apporopriate --enable-kernel setting). The current RHEL6 operating system is based on a maintained kernel based on 2.6.32 with lots of backports. We provide basic support for this specific kernel by patching glibc to provide an exception for this specific version of kernel. This allows for nixpkgs software distribution to work on RHEL6 and it does so quite well with almost no problems. There are, however, a few syscalls that are missing in the 2.6.32 kernel, one of which is prlimit64. This commit provides a fallback that uses an older {get,set}rlimit syscalls in cases when prlimit64 is not available. This should streamline the experience for nixpkgs users wanting to run it on RHEL6, namely, this fixes one of the tests in findutils. See also discussion in guix: https://lists.gnu.org/archive/html/guix-devel/2018-03/msg00356.html --- pkgs/development/libraries/glibc/common.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pkgs/development/libraries') diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index d1ff681097dd..50ee5097d1b8 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -89,6 +89,18 @@ stdenv.mkDerivation ({ 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"; + }) + /* Provide utf-8 locales by default, so we can use it in stdenv without depending on our large locale-archive. */ (fetchurl { url = "https://salsa.debian.org/glibc-team/glibc/raw/49767c9f7de4828220b691b29de0baf60d8a54ec/debian/patches/localedata/locale-C.diff"; -- cgit 1.4.1