From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: glibc 2.26 refuses to run on CentOS 6.8 Date: Mon, 19 Feb 2018 20:09:58 +0100 Message-ID: <87a7w4ssmx.fsf@mdc-berlin.de> References: <87eflgstqt.fsf@mdc-berlin.de> <87d110stkn.fsf@mdc-berlin.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enqpS-0001bx-JH for guix-devel@gnu.org; Mon, 19 Feb 2018 14:10:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enqpO-00004x-Su for guix-devel@gnu.org; Mon, 19 Feb 2018 14:10:22 -0500 Received: from pegasus.bbbm.mdc-berlin.de ([141.80.25.20]:41204) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enqpO-0008U7-BF for guix-devel@gnu.org; Mon, 19 Feb 2018 14:10:18 -0500 Received: from localhost (localhost [127.0.0.1]) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTP id 6A92778C197 for ; Mon, 19 Feb 2018 20:10:16 +0100 (CET) Received: from pegasus.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (pegasus.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hp98dnFEJWHJ for ; Mon, 19 Feb 2018 20:10:10 +0100 (CET) Received: from HTCATWO.mdc-berlin.net (puck.citx.mdc-berlin.de [141.80.36.101]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTPS for ; Mon, 19 Feb 2018 20:10:10 +0100 (CET) In-Reply-To: <87d110stkn.fsf@mdc-berlin.de> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Ricardo Wurmus writes: > Ricardo Wurmus writes: > >> The NixOS developers patch glibc to make sure that all software still >> runs on Linux 2.6.32: >> >> https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/develo= pment/libraries/glibc/allow-kernel-2.6.32.patch >> >> Can we please also apply this? > > We could also apply this conditionally to x86_64 only, because that=E2=80= =99s > probably the only architecture that=E2=80=99s used for HPC systems runn= ing > CentOS. Here=E2=80=99s a patch to graft the glibc to apply the patch to allow the= 2.6.32 kernel. I=E2=80=99m going to apply this at work now. --=20 Ricardo --=-=-= Content-Type: text/x-patch; charset="utf-8" Content-Disposition: inline; filename="0001-WIP-graft-glibc-to-allow-execution-on-Linux-2.6.32.patch" Content-Transfer-Encoding: quoted-printable >From 5f9a81cbb4ab97a20b62c2e7e9505877a5b004e8 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 19 Feb 2018 20:04:06 +0100 Subject: [PATCH] WIP graft glibc to allow execution on Linux 2.6.32. * gnu/packages/patches/glibc-allow-kernel-2.6.32.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/base.scm (glibc/linux)[replacement]: Register glibc-2.26-patched as replacement. (glibc-2.26-patched): New variable. (glibc-2.25, glibc-2.24, glibc-2.23, glibc-2.22): Disable replacement. * gnu/packages/commencement.scm (glibc-final-with-bootstrap-bash, glibc-final): Likewise. --- gnu/local.mk | 3 +- gnu/packages/base.scm | 15 +++++++++ gnu/packages/commencement.scm | 3 ++ .../patches/glibc-allow-kernel-2.6.32.patch | 39 ++++++++++++++++= ++++++ 4 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/glibc-allow-kernel-2.6.32.patch diff --git a/gnu/local.mk b/gnu/local.mk index f1834e368..c7bd4c6a9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -7,7 +7,7 @@ # Copyright =C2=A9 2016, 2017 Kei Kebreau # Copyright =C2=A9 2016, 2017 Rene Saavedra # Copyright =C2=A9 2016 Adonay "adfeno" Felipe Nogueira -# Copyright =C2=A9 2016, 2017 Ricardo Wurmus +# Copyright =C2=A9 2016, 2017, 2018 Ricardo Wurmus # Copyright =C2=A9 2016 Ben Woodcroft # Copyright =C2=A9 2016, 2017, 2018 Alex Vong # Copyright =C2=A9 2016, 2017 Efraim Flashner @@ -705,6 +705,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/glibc-CVE-2017-1000366-pt1.patch \ %D%/packages/patches/glibc-CVE-2017-1000366-pt2.patch \ %D%/packages/patches/glibc-CVE-2017-1000366-pt3.patch \ + %D%/packages/patches/glibc-allow-kernel-2.6.32.patch \ %D%/packages/patches/glibc-bootstrap-system.patch \ %D%/packages/patches/glibc-ldd-x86_64.patch \ %D%/packages/patches/glibc-locales.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index b2c1d232f..d16bc6d26 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -12,6 +12,7 @@ ;;; Copyright =C2=A9 2017 Mathieu Othacehe ;;; Copyright =C2=A9 2017 Marius Bakke ;;; Copyright =C2=A9 2017 Eric Bavier +;;; Copyright =C2=A9 2018 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -537,6 +538,7 @@ store.") ;; Note: Always use a dot after the minor version since various place= s rely ;; on "version-major+minor" to determine where locales are found. (version "2.26.105-g0890d5379c") + (replacement glibc-2.26-patched) (source (origin (method url-fetch) (uri (string-append "https://alpha.gnu.org/gnu/guix/mirror/" @@ -839,10 +841,20 @@ GLIBC/HURD for a Hurd host" ;; Below are old libc versions, which we use mostly to build locale data= in ;; the old format (which the new libc cannot cope with.) =20 +(define glibc-2.26-patched + (package + (inherit glibc) + (replacement #f) + (source (origin + (inherit (package-source glibc)) + (patches (cons (search-patch "glibc-allow-kernel-2.6.32.pa= tch") + (origin-patches (package-source base)))))))= ) + (define-public glibc-2.25 (package (inherit glibc) (version "2.25") + (replacement #f) (source (origin (inherit (package-source glibc)) (uri (string-append "mirror://gnu/glibc/glibc-" @@ -862,6 +874,7 @@ GLIBC/HURD for a Hurd host" (package (inherit glibc) (version "2.24") + (replacement #f) (source (origin (inherit (package-source glibc)) (uri (string-append "mirror://gnu/glibc/glibc-" @@ -882,6 +895,7 @@ GLIBC/HURD for a Hurd host" (package (inherit glibc) (version "2.23") + (replacement #f) (source (origin (inherit (package-source glibc)) (uri (string-append "mirror://gnu/glibc/glibc-" @@ -905,6 +919,7 @@ GLIBC/HURD for a Hurd host" (package (inherit glibc) (version "2.22") + (replacement #f) (source (origin (inherit (package-source glibc)) (uri (string-append "mirror://gnu/glibc/glibc-" diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.sc= m index 7286e954c..f57662ab4 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2012 Nikita Karetnikov ;;; Copyright =C2=A9 2014, 2015, 2017 Mark H Weaver ;;; Copyright =C2=A9 2017, 2018 Efraim Flashner +;;; Copyright =C2=A9 2018 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -488,6 +489,7 @@ the bootstrap environment." (package-with-bootstrap-guile (package (inherit glibc) (name "glibc-intermediate") + (replacement #f) (arguments `(#:guile ,%bootstrap-guile #:implicit-inputs? #f @@ -666,6 +668,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a= /~a \"$@\"~%" ;; The final glibc, which embeds the statically-linked Bash built abov= e. (package (inherit glibc-final-with-bootstrap-bash) (name "glibc") + (replacement #f) (inputs `(("static-bash" ,static-bash-for-glibc) ,@(alist-delete "static-bash" diff --git a/gnu/packages/patches/glibc-allow-kernel-2.6.32.patch b/gnu/p= ackages/patches/glibc-allow-kernel-2.6.32.patch new file mode 100644 index 000000000..ce18b874c --- /dev/null +++ b/gnu/packages/patches/glibc-allow-kernel-2.6.32.patch @@ -0,0 +1,39 @@ +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=3D`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\= .\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`; +-abinum=3D`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\= .\([0-9]*\).*/\1,\2,\3/'`; ++abinum=3D`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/li= nux/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=3D`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\= .\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`; +-abinum=3D`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\= .\([0-9]*\).*/\1,\2,\3/'`; ++abinum=3D`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/lin= ux/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) =3D 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 !=3D 0x020620) \ + /* Not sufficent. */ \ + FATAL ("FATAL: kernel too old\n"); \ + } \ --=20 2.16.2 --=-=-=--