From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: guix-devel@gnu.org
Cc: 30537@debbugs.gnu.org
Subject: bug#30537: glibc 2.26 refuses to run on CentOS 6.8
Date: Mon, 19 Feb 2018 20:41:07 +0100 [thread overview]
Message-ID: <878tbosr7h.fsf__42696.9959903092$1519069693$gmane$org@mdc-berlin.de> (raw)
In-Reply-To: <87a7w4ssmx.fsf@mdc-berlin.de>
[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:
> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:
>
>> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> 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/development/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’s
>> probably the only architecture that’s used for HPC systems running
>> CentOS.
>
> Here’s a patch to graft the glibc to apply the patch to allow the 2.6.32
> kernel. I’m going to apply this at work now.
That patch had a couple of problems. Here’s a new version.
The main differences are:
* fix an undefined variable (“base” –> “glibc”)
* use package/inherit for glibc-final and
glibc-final-with-bootstrap-bash; don’t override the “replacement”
field with “#f”
--
Ricardo
[-- Attachment #2: 0001-WIP-graft-glibc-to-allow-execution-on-Linux-2.6.32.patch --]
[-- Type: text/x-patch, Size: 8165 bytes --]
From 3cf46dce4129cb52574de52b4221f6c4dde566fe Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
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]: New field.
(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): Use package/inherit to enable grafted glibc.
---
gnu/local.mk | 3 +-
gnu/packages/base.scm | 15 +++++++++
gnu/packages/commencement.scm | 5 +--
.../patches/glibc-allow-kernel-2.6.32.patch | 39 ++++++++++++++++++++++
4 files changed, 59 insertions(+), 3 deletions(-)
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 © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
# Copyright © 2016, 2017 Rene Saavedra <rennes@openmailbox.org>
# Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
-# Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
+# Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
# Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
# Copyright © 2016, 2017, 2018 Alex Vong <alexvong1995@gmail.com>
# Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
@@ -705,6 +705,7 @@ dist_patch_DATA = \
%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..111bbbcec 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -537,6 +538,7 @@ store.")
;; Note: Always use a dot after the minor version since various places 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.)
+(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.patch")
+ (origin-patches (package-source glibc))))))))
+
(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.scm
index 7286e954c..db43691fd 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -486,7 +487,7 @@ the bootstrap environment."
;; built just below; the only difference is that this one uses the
;; bootstrap Bash.
(package-with-bootstrap-guile
- (package (inherit glibc)
+ (package/inherit glibc
(name "glibc-intermediate")
(arguments
`(#:guile ,%bootstrap-guile
@@ -664,7 +665,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(define glibc-final
;; The final glibc, which embeds the statically-linked Bash built above.
- (package (inherit glibc-final-with-bootstrap-bash)
+ (package/inherit glibc-final-with-bootstrap-bash
(name "glibc")
(inputs `(("static-bash" ,static-bash-for-glibc)
,@(alist-delete
diff --git a/gnu/packages/patches/glibc-allow-kernel-2.6.32.patch b/gnu/packages/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=`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 <linux/version.h>
+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 <linux/version.h>
+ #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"); \
+ } \
--
2.16.2
next prev parent reply other threads:[~2018-02-19 19:42 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 18:46 glibc 2.26 refuses to run on CentOS 6.8 Ricardo Wurmus
2018-02-19 18:49 ` Ricardo Wurmus
2018-02-19 19:09 ` Ricardo Wurmus
2018-02-19 19:28 ` Danny Milosavljevic
2018-02-19 21:22 ` Ricardo Wurmus
2018-02-19 22:46 ` Danny Milosavljevic
2018-02-19 19:41 ` Ricardo Wurmus
2018-02-19 20:28 ` bug#30537: " Jan Nieuwenhuizen
2018-02-21 23:12 ` Mark H Weaver
2018-02-22 20:30 ` Efraim Flashner
2018-02-22 20:30 ` Efraim Flashner
2018-02-23 22:01 ` bug#30537: Grafts vs. early bootstrapping packages Ludovic Courtès
2018-02-21 23:12 ` bug#30537: glibc 2.26 refuses to run on CentOS 6.8 Mark H Weaver
2018-02-19 19:41 ` Ricardo Wurmus [this message]
2018-02-20 1:22 ` Leo Famulari
2018-02-20 11:52 ` Leo Famulari
2018-02-20 12:34 ` Ricardo Wurmus
2018-02-20 12:51 ` Leo Famulari
2018-02-20 14:33 ` Ricardo Wurmus
2018-02-20 17:55 ` Ricardo Wurmus
2018-02-20 9:39 ` Efraim Flashner
2018-02-23 22:26 ` Ludovic Courtès
2018-02-23 22:26 ` bug#30537: " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='878tbosr7h.fsf__42696.9959903092$1519069693$gmane$org@mdc-berlin.de' \
--to=ricardo.wurmus@mdc-berlin.de \
--cc=30537@debbugs.gnu.org \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.