unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* glibc 2.26 refuses to run on CentOS 6.8
@ 2018-02-19 18:46 Ricardo Wurmus
  2018-02-19 18:49 ` Ricardo Wurmus
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ricardo Wurmus @ 2018-02-19 18:46 UTC (permalink / raw)
  To: bug-guix; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

Hi Guix,

I have a bad day.  After the upgrade to glibc 2.26 none of the
Guix-installed software runs on the HPC cluster running CentOS 6.8.

The glibc 2.26 expects a minimum kernel version of 3.x on x86_64, but
CentOS 6.8 only comes with a heavily patched 2.6.32.

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?  Without this Guix on HPC is pretty much
dead at the MDC.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: allow-kernel-2.6.32.patch --]
[-- Type: text/x-patch, Size: 2143 bytes --]

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");				      \
       }									      \

[-- Attachment #3: Type: text/plain, Size: 12 bytes --]


--
Ricardo

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: glibc 2.26 refuses to run on CentOS 6.8
  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-20  9:39 ` bug#30537: glibc 2.26 refuses to run on CentOS 6.8 Efraim Flashner
  2018-02-23 22:26 ` Ludovic Courtès
  2 siblings, 1 reply; 13+ messages in thread
From: Ricardo Wurmus @ 2018-02-19 18:49 UTC (permalink / raw)
  To: guix-devel


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.

--
Ricardo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: glibc 2.26 refuses to run on CentOS 6.8
  2018-02-19 18:49 ` Ricardo Wurmus
@ 2018-02-19 19:09   ` Ricardo Wurmus
  2018-02-19 19:28     ` Danny Milosavljevic
  2018-02-19 19:41     ` Ricardo Wurmus
  0 siblings, 2 replies; 13+ messages in thread
From: Ricardo Wurmus @ 2018-02-19 19:09 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]


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.

-- 
Ricardo


[-- Attachment #2: 0001-WIP-graft-glibc-to-allow-execution-on-Linux-2.6.32.patch --]
[-- Type: text/x-patch, Size: 8257 bytes --]

From 5f9a81cbb4ab97a20b62c2e7e9505877a5b004e8 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]: 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 © 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..d16bc6d26 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 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.scm
index 7286e954c..f57662ab4 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.
 ;;;
@@ -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 above.
   (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/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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: glibc 2.26 refuses to run on CentOS 6.8
  2018-02-19 19:09   ` Ricardo Wurmus
@ 2018-02-19 19:28     ` Danny Milosavljevic
  2018-02-19 21:22       ` Ricardo Wurmus
  2018-02-19 19:41     ` Ricardo Wurmus
  1 sibling, 1 reply; 13+ messages in thread
From: Danny Milosavljevic @ 2018-02-19 19:28 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hi Ricardo,

sorry to hear about those problems.

Can you try just passing --enable-kernel=2.6.32 to "configure" of glibc instead?

It should set the minimal version without any weird patching.

Our glibc/linux in gnu/packages/base.scm specifies --enable-kernel=3.2.0 which
we could modify to something older.

But newer glibc has moved a lot of kernel definitions into glibc, might cause a
problem if glibc just assumes it's all there but in fact it's not there at
runtime (like the recent Haskell problem etc).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: glibc 2.26 refuses to run on CentOS 6.8
  2018-02-19 19:09   ` Ricardo Wurmus
  2018-02-19 19:28     ` 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
  1 sibling, 2 replies; 13+ messages in thread
From: Ricardo Wurmus @ 2018-02-19 19:41 UTC (permalink / raw)
  To: guix-devel; +Cc: 30537

[-- Attachment #1: Type: text/plain, Size: 1063 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: 8349 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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#30537: glibc 2.26 refuses to run on CentOS 6.8
  2018-02-19 19:41     ` Ricardo Wurmus
@ 2018-02-19 20:28       ` Jan Nieuwenhuizen
  2018-02-21 23:12       ` Mark H Weaver
  1 sibling, 0 replies; 13+ messages in thread
From: Jan Nieuwenhuizen @ 2018-02-19 20:28 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel, 30537

Ricardo Wurmus writes:

>> 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.

Sad to hear of your troubles, thanks a lot for posting this.  We
discovered at Verum that a guix pack would not run on CentOS and
took another road in the end.  Good to know there's still a way
to work around this.

Thanks,
janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: glibc 2.26 refuses to run on CentOS 6.8
  2018-02-19 19:28     ` Danny Milosavljevic
@ 2018-02-19 21:22       ` Ricardo Wurmus
  2018-02-19 22:46         ` Danny Milosavljevic
  0 siblings, 1 reply; 13+ messages in thread
From: Ricardo Wurmus @ 2018-02-19 21:22 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel, Ricardo Wurmus, 30537


Hi Danny,

> Can you try just passing --enable-kernel=2.6.32 to "configure" of glibc instead?
>
> It should set the minimal version without any weird patching.

Does this work even though the official minimum kernel version for glibc
2.26 is 3.2.0?

> But newer glibc has moved a lot of kernel definitions into glibc, might cause a
> problem if glibc just assumes it's all there but in fact it's not there at
> runtime (like the recent Haskell problem etc).

The Red Hat kernels are a bit special in that they are not just old
kernels, but heavily patched to work with newer software.  The Nix
people wrote that they have confirmed that 2.6.32 works up to
glibc-2.26-131.

There are additional notes on how that was done:

    # 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

If there was a way to test for kernel features instead of looking at the
kernel version I’d do that instead of looking for a way to relax the
lower kernel version bound.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: glibc 2.26 refuses to run on CentOS 6.8
  2018-02-19 21:22       ` Ricardo Wurmus
@ 2018-02-19 22:46         ` Danny Milosavljevic
  0 siblings, 0 replies; 13+ messages in thread
From: Danny Milosavljevic @ 2018-02-19 22:46 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel, Ricardo Wurmus, 30537

Hi Ricardo,

> Does this work even though the official minimum kernel version for glibc
> 2.26 is 3.2.0?

I think so, BUT the patchset looks pretty similar to what would happen
if you specified the configure flag except for one spot.
So maybe Nix found out some ill effects.

The most worrying part in glibc is

#if __LINUX_KERNEL_VERSION < 0x040300
# undef __ASSUME_ACCEPT4_SYSCALL
# undef __ASSUME_SENDMSG_SYSCALL
# undef __ASSUME_RECVMSG_SYSCALL
# undef __ASSUME_CONNECT_SYSCALL
# undef __ASSUME_RECVFROM_SYSCALL
# undef __ASSUME_SENDTO_SYSCALL
#endif

So that would have to be watched out for.

__ASSUME_CONNECT_SYSCALL is some scary stuff.  Getting it wrong could break all
networking in the system.

> The Red Hat kernels are a bit special in that they are not just old
> kernels, but heavily patched to work with newer software.  The Nix
> people wrote that they have confirmed that 2.6.32 works up to
> glibc-2.26-131.

Oh, I didn't know that.  If it's tested that way, let's use it that way
for the time being.

> If there was a way to test for kernel features instead of looking at the
> kernel version I’d do that instead of looking for a way to relax the
> lower kernel version bound.

Yeah...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#30537: glibc 2.26 refuses to run on CentOS 6.8
  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-20  9:39 ` Efraim Flashner
  2018-02-23 22:26 ` Ludovic Courtès
  2 siblings, 0 replies; 13+ messages in thread
From: Efraim Flashner @ 2018-02-20  9:39 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel, 30537

[-- Attachment #1: Type: text/plain, Size: 968 bytes --]

On Mon, Feb 19, 2018 at 07:46:02PM +0100, Ricardo Wurmus wrote:
> Hi Guix,
> 
> I have a bad day.  After the upgrade to glibc 2.26 none of the
> Guix-installed software runs on the HPC cluster running CentOS 6.8.
> 
> The glibc 2.26 expects a minimum kernel version of 3.x on x86_64, but
> CentOS 6.8 only comes with a heavily patched 2.6.32.
> 
> 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?  Without this Guix on HPC is pretty much
> dead at the MDC.
> 

We should also update the docs with the (new) minimum specs as needed.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bug#30537: glibc 2.26 refuses to run on CentOS 6.8
  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-23 22:01         ` bug#30537: Grafts vs. early bootstrapping packages Ludovic Courtès
  1 sibling, 2 replies; 13+ messages in thread
From: Mark H Weaver @ 2018-02-21 23:12 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel, 30537

Hi Ricardo,

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:
>
>> 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.

[...]

> 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-"

These (replacement #f) fields should not be needed.  'replacement' is
now an 'innate' field of the package record type, which means that it is
not inherited.

> 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

We seem to be oscillating on the question of whether to graft these
early GLIBCs.  In June 2017, I switched to using 'package/inherit' here
in commit 13f7f2fd2b208c29361ef2290f55911879a6adf2, and in October those
changes were reverted in commit 848f550f2c105326dc3be4033c8aaf35ec21cde4
by Efraim, although I'm not sure why.

It'll be painful to have *everything* grafted until the next
core-updates cycle, but I suppose it's necessary.

      Thanks,
        Mark

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bug#30537: glibc 2.26 refuses to run on CentOS 6.8
  2018-02-21 23:12       ` Mark H Weaver
@ 2018-02-22 20:30         ` Efraim Flashner
  2018-02-23 22:01         ` bug#30537: Grafts vs. early bootstrapping packages Ludovic Courtès
  1 sibling, 0 replies; 13+ messages in thread
From: Efraim Flashner @ 2018-02-22 20:30 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel, Ricardo Wurmus, 30537

[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]

On Wed, Feb 21, 2018 at 06:12:31PM -0500, Mark H Weaver wrote:
> Hi Ricardo,
> 
...
> 
> We seem to be oscillating on the question of whether to graft these
> early GLIBCs.  In June 2017, I switched to using 'package/inherit' here
> in commit 13f7f2fd2b208c29361ef2290f55911879a6adf2, and in October those
> changes were reverted in commit 848f550f2c105326dc3be4033c8aaf35ec21cde4
> by Efraim, although I'm not sure why.
> 

Probably a misunderstanding on my part, I assumed it was switched to
package/inherit as part of the grafting, and then should be switched
back.

> It'll be painful to have *everything* grafted until the next
> core-updates cycle, but I suppose it's necessary.
> 
>       Thanks,
>         Mark
> 

We could also have an 'ungraft everything' branch before we get to the
next round of core-updates.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#30537: Grafts vs. early bootstrapping packages
  2018-02-21 23:12       ` Mark H Weaver
  2018-02-22 20:30         ` Efraim Flashner
@ 2018-02-23 22:01         ` Ludovic Courtès
  1 sibling, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2018-02-23 22:01 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel, Ricardo Wurmus, 30537

Hello,

Mark H Weaver <mhw@netris.org> skribis:

>> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

[...]

>>  (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
>
> We seem to be oscillating on the question of whether to graft these
> early GLIBCs.  In June 2017, I switched to using 'package/inherit' here
> in commit 13f7f2fd2b208c29361ef2290f55911879a6adf2, and in October those
> changes were reverted in commit 848f550f2c105326dc3be4033c8aaf35ec21cde4
> by Efraim, although I'm not sure why.

I doesn’t make sense to graft “glibc-intermediate” because it’s only
used in ‘static-bash-for-glibc’, which statically links against it.  The
situation is similar with the “-boot0” packages: they are not referenced
by the packages we use.

So I think 848f550f2c105326dc3be4033c8aaf35ec21cde4 was a good idea.
f00b85ff8d34df0a1879e593d4a85629b8586af7 does something similar.

Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: glibc 2.26 refuses to run on CentOS 6.8
  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-20  9:39 ` bug#30537: glibc 2.26 refuses to run on CentOS 6.8 Efraim Flashner
@ 2018-02-23 22:26 ` Ludovic Courtès
  2 siblings, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2018-02-23 22:26 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel, 30537

Hello,

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> I have a bad day.  After the upgrade to glibc 2.26 none of the
> Guix-installed software runs on the HPC cluster running CentOS 6.8.

Bah.  :-(

> The glibc 2.26 expects a minimum kernel version of 3.x on x86_64, but
> CentOS 6.8 only comes with a heavily patched 2.6.32.

It’s annoying, but we can surely apply the patch you sent (though rather
by passing ‘--enable-kernel’ if possible, as Danny suggested.)


personality(2) has a knob to change the kernel version reported by
uname(2) to 2.6.  Here it’s a case where we’d need the reverse:
reporting 3.2 instead of 2.6.  That doesn’t seem to exist.

Looking for other hacks (or kludges), I found the kernel module below at
<https://www.linuxquestions.org/questions/linux-general-1/uname-hack-modules-in-kernel-2-6-a-172167/>,
which could be adjusted to report a different kernel version:

--8<---------------cut here---------------start------------->8---
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/utsname.h>

#ifndef UNAME_DUMB_STEPPING
#define UNAME_DUMB_STEPPING '5';
#endif

MODULE_AUTHOR("The one who invented the uname hack");
MODULE_DESCRIPTION("Changes the uname output");
MODULE_LICENSE("GPL");

static int uname_hack_init() {
	save = system_utsname.machine[1];
	system_utsname.machine[1] = UNAME_DUMB_STEPPING;
	return 0;
}

static void uname_hack_cleanup() {
	system_utsname.machine[1] = save;
}

module_init(uname_hack_init);
module_exit(uname_hack_cleanup);
--8<---------------cut here---------------end--------------->8---

Another option would be to ptrace processes, handle the first ‘uname’
call, and then PTRACE_DETACH.  Ugly.

Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-02-23 22:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-23 22:01         ` bug#30537: Grafts vs. early bootstrapping packages Ludovic Courtès
2018-02-20  9:39 ` bug#30537: glibc 2.26 refuses to run on CentOS 6.8 Efraim Flashner
2018-02-23 22:26 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).