unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#67686] [PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available
@ 2023-12-07 10:19 Ludovic Courtès
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 10:19 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

Hello fellow core updaters!

Here’s a patch to (1) upgrade glibc on ‘core-updates’, and (2) make the
“C.UTF-8” locale always available.

The upgrade itself will need several iterations so we can check whether
cross-compilation still works, for which we need help from ci.guix.
It removes ‘glibc-allow-kernel-2.6.32.patch’, which no longer applies,
so we’ll have to do a poll to ensure nobody relies on this (this is
mostly for HPC people, who tend to have machines running old and
heavily-patched kernels, but hopefully this particular flavor is now
gone.)

With the upgrade, we should be able to:

  (define-public glibc/hurd glibc)

Perhaps we’ll even get support for x86_64-gnu (!), though IIRC we may
need a couple more patches.

As for #2, it means that:

  setlocale (LC_ALL, "C.UTF-8");

is guaranteed to always succeed.  This is pretty big deal for us
because then we can get rid of most use cases for ‘glibc-utf8-locales’.
The main use of ‘glibc-utf8-locales’ is to ensure that Guile (and other
programs that behave similar) can run in a UTF-8 locale and thus
decode file names & co. according to that locale’s encoding.  We’ll
be able to replace snippets like:

  #~(begin
      (setenv "GUIX_LOCPATH"
              #$(file-append glibc-utf8-locales "/lib/locale"))
      (setlocale LC_ALL "en_US.utf8")
      …)

with:

  #~(begin
      (setlocale LC_ALL "C.UTF-8")
      …)

Thoughts?

Note that I needed Greg’s GCC 11.4.0 upgrade
from <https://issues.guix.gnu.org/66730> as a prerequisite
since libsanitizer in GCC 11.3.0 fails to build with glibc 2.38.

Ludo’.

Greg Hogan (1):
  gnu: gcc@11: Update to 11.4.0.

Ludovic Courtès (4):
  gnu: glibc-utf8-locales: Generalize and use gexps.
  DRAFT gnu: glibc: Update to 2.38.
  gnu: glibc: Install C.UTF-8 locale.
  gnu: glibc: Ensure C.UTF-8 locale is always found.

 gnu/local.mk                                  |   2 +-
 gnu/packages/base.scm                         | 143 ++++++++++++------
 gnu/packages/gcc.scm                          |   7 +-
 .../gcc-10-tree-sra-union-handling.patch      |  33 ----
 .../glibc-2.37-versioned-locpath.patch        |  57 ++++---
 .../patches/glibc-2.38-ldd-x86_64.patch       |   8 +
 6 files changed, 138 insertions(+), 112 deletions(-)
 delete mode 100644 gnu/packages/patches/gcc-10-tree-sra-union-handling.patch
 create mode 100644 gnu/packages/patches/glibc-2.38-ldd-x86_64.patch


base-commit: 69d31a158001f2cb97983bd13f4575f6c9484451
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0.
  2023-12-07 10:19 [bug#67686] [PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
@ 2023-12-07 10:22 ` Ludovic Courtès
  2023-12-07 20:11   ` Janneke Nieuwenhuizen
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 2/5] gnu: glibc-utf8-locales: Generalize and use gexps Ludovic Courtès
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 10:22 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès, Greg Hogan

From: Greg Hogan <code@greghogan.com>

* gnu/packages/gcc.scm (gcc-11): Update to 11.4.0.
Remove ‘gcc-10-tree-sra-union-handling.patch’.
* gnu/local.mk: Delist patch.
* gnu/packages/patches/gcc-10-tree-sra-union-handling.patch: Delete.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/local.mk                                  |  1 -
 gnu/packages/gcc.scm                          |  7 ++--
 .../gcc-10-tree-sra-union-handling.patch      | 33 -------------------
 3 files changed, 3 insertions(+), 38 deletions(-)
 delete mode 100644 gnu/packages/patches/gcc-10-tree-sra-union-handling.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ce850c9f7e..f1839319c8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1250,7 +1250,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-10-cross-environment-variables.patch \
   %D%/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch   \
   %D%/packages/patches/gcc-12-cross-environment-variables.patch \
-  %D%/packages/patches/gcc-10-tree-sra-union-handling.patch	\
   %D%/packages/patches/gcc-11-libstdc++-powerpc.patch           \
   %D%/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch	\
   %D%/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch	\
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 3137fe2d75..313a92d8aa 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -719,17 +719,16 @@ (define-public gcc-10
 (define-public gcc-11
   (package
    (inherit gcc-8)
-   (version "11.3.0")
+   (version "11.4.0")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/gcc/gcc-"
                                 version "/gcc-" version ".tar.xz"))
             (sha256
              (base32
-              "0fdclcwf728wbq52vphfcjywzhpsjp3kifzj3pib3xcihs0z4z5l"))
+              "1ncd7akww0hl5kkmw1dj3qgqp3phdrr5dfnm7jia9s07n0ib4b9z"))
             (patches (search-patches "gcc-9-strmov-store-file-names.patch"
-                                     "gcc-5.0-libvtv-runpath.patch"
-                                     "gcc-10-tree-sra-union-handling.patch"))
+                                     "gcc-5.0-libvtv-runpath.patch"))
             (modules '((guix build utils)))
             (snippet gcc-canadian-cross-objdump-snippet)))
    (arguments
diff --git a/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch b/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch
deleted file mode 100644
index aae5fc9f72..0000000000
--- a/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Fix a regression in GCC 10/11/12 where some union structures
-could get miscompiled when optimizations are enabled:
-
-  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105860
-
-Taken from upstream:
-
-  https://gcc.gnu.org/g:16afe2e2862f3dd93c711d7f8d436dee23c6c34d
-
-diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
-index 09d951a261b..420329f63f6 100644
---- a/gcc/tree-sra.c
-+++ b/gcc/tree-sra.c
-@@ -1647,7 +1647,18 @@ build_ref_for_offset (location_t loc, tree base, poly_int64 offset,
- static tree
- build_reconstructed_reference (location_t, tree base, struct access *model)
- {
--  tree expr = model->expr, prev_expr = NULL;
-+  tree expr = model->expr;
-+  /* We have to make sure to start just below the outermost union.  */
-+  tree start_expr = expr;
-+  while (handled_component_p (expr))
-+    {
-+      if (TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == UNION_TYPE)
-+	start_expr = expr;
-+      expr = TREE_OPERAND (expr, 0);
-+    }
-+
-+  expr = start_expr;
-+  tree prev_expr = NULL_TREE;
-   while (!types_compatible_p (TREE_TYPE (expr), TREE_TYPE (base)))
-     {
-       if (!handled_component_p (expr))
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates 2/5] gnu: glibc-utf8-locales: Generalize and use gexps.
  2023-12-07 10:19 [bug#67686] [PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
@ 2023-12-07 10:22 ` Ludovic Courtès
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 3/5] DRAFT gnu: glibc: Update to 2.38 Ludovic Courtès
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 10:22 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

Previously code was dependent on the ‘name’ field of the GLIBC package.

* gnu/packages/base.scm (make-glibc-utf8-locales): Use gexps.  Replace
references to ‘%build-inputs’ by calls to ‘which’.  Replace reference to
‘version’ by (package-version this-package).

Change-Id: I1e7003047aa85df74069b233191ab331b5f887b6
---
 gnu/packages/base.scm | 67 +++++++++++++++++++++++--------------------
 1 file changed, 36 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index b4982107b2..f95ae1b679 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1348,47 +1348,52 @@ (define %default-utf8-locales
 (define*-public (make-glibc-utf8-locales glibc #:key
                                          (locales %default-utf8-locales)
                                          (name "glibc-utf8-locales"))
-  (define default-locales? (equal? locales %default-utf8-locales))
+  (define default-locales?
+    (equal? locales %default-utf8-locales))
+
   (package
     (name name)
     (version (package-version glibc))
     (source #f)
     (build-system trivial-build-system)
     (arguments
-     `(#:modules ((guix build utils))
-       #:builder (begin
-                   (use-modules (guix build utils))
+     (list #:modules '((guix build utils))
+           #:builder
+           #~(begin
+               (use-modules (guix build utils))
 
-                   (let* ((libc      (assoc-ref %build-inputs "glibc"))
-                          (gzip      (assoc-ref %build-inputs "gzip"))
-                          (out       (assoc-ref %outputs "out"))
-                          (localedir (string-append out "/lib/locale/"
-                                                    ,(version-major+minor version))))
-                     ;; 'localedef' needs 'gzip'.
-                     (setenv "PATH" (string-append libc "/bin:" gzip "/bin"))
+               (let* ((libc      (dirname
+                                  (search-input-file %build-inputs
+                                                     "/bin/localedef")))
+                      (gzip      (dirname
+                                  (search-input-file %build-inputs
+                                                     "/bin/gzip")))
+                      (out       #$output)
+                      (localedir (string-append out "/lib/locale/"
+                                                #$(version-major+minor
+                                                   (package-version this-package)))))
+                 ;; 'localedef' needs 'gzip'.
+                 (setenv "PATH" (string-append libc ":" gzip ""))
 
-                     (mkdir-p localedir)
-                     (for-each (lambda (locale)
-                                 (define file
-                                   ;; Use the "normalized codeset" by
-                                   ;; default--e.g., "en_US.utf8".
-                                   (string-append localedir "/" locale ".utf8"))
+                 (mkdir-p localedir)
+                 (for-each (lambda (locale)
+                             (define file
+                               ;; Use the "normalized codeset" by
+                               ;; default--e.g., "en_US.utf8".
+                               (string-append localedir "/" locale ".utf8"))
 
-                                 (invoke "localedef" "--no-archive"
-                                         "--prefix" localedir
-                                         "-i" locale
-                                         "-f" "UTF-8" file)
+                             (invoke "localedef" "--no-archive"
+                                     "--prefix" localedir
+                                     "-i" locale
+                                     "-f" "UTF-8" file)
 
-                                 ;; For backward compatibility with Guix
-                                 ;; <= 0.8.3, add "xx_YY.UTF-8".
-                                 (symlink (string-append locale ".utf8")
-                                          (string-append localedir "/"
-                                                         locale ".UTF-8")))
-                               ',locales)
-                     #t))))
-    (native-inputs
-     `(("glibc" ,glibc)
-       ("gzip" ,gzip)))
+                             ;; For backward compatibility with Guix
+                             ;; <= 0.8.3, add "xx_YY.UTF-8".
+                             (symlink (string-append locale ".utf8")
+                                      (string-append localedir "/"
+                                                     locale ".UTF-8")))
+                           '#$locales)))))
+    (native-inputs (list glibc gzip))
     (synopsis (if default-locales?
                   (P_ "Small sample of UTF-8 locales")
                   (P_ "Customized sample of UTF-8 locales")))
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates 3/5] DRAFT gnu: glibc: Update to 2.38.
  2023-12-07 10:19 [bug#67686] [PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 2/5] gnu: glibc-utf8-locales: Generalize and use gexps Ludovic Courtès
@ 2023-12-07 10:22 ` Ludovic Courtès
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale Ludovic Courtès
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 10:22 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

DRAFT: Two questions:

  1. Can we abandon ‘glibc-allow-kernel-2.6.32’ (CentOS 6)?

  2. Check cross-compilation.

* gnu/packages/patches/glibc-2.38-ldd-x86_64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/base.scm (glibc): Update to 2.38.
[source]: Adjust list of patches.
[arguments]: Add ‘--enable-crypt’.
(glibc-2.35): New variable.

Change-Id: I040b724c47d2ee5f90f2deb03a4828e79d1bfc4e
---
 gnu/local.mk                                  |  1 +
 gnu/packages/base.scm                         | 47 +++++++++++++++----
 .../glibc-2.37-versioned-locpath.patch        | 35 +++-----------
 .../patches/glibc-2.38-ldd-x86_64.patch       |  8 ++++
 4 files changed, 52 insertions(+), 39 deletions(-)
 create mode 100644 gnu/packages/patches/glibc-2.38-ldd-x86_64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f1839319c8..7ecc828003 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1304,6 +1304,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/glibc-2.37-hurd-clock_t_centiseconds.patch	\
   %D%/packages/patches/glibc-2.37-hurd-local-clock_gettime_MONOTONIC.patch	\
   %D%/packages/patches/glibc-2.37-versioned-locpath.patch	\
+  %D%/packages/patches/glibc-2.38-ldd-x86_64.patch		\
   %D%/packages/patches/glibc-hurd-clock_t_centiseconds.patch	\
   %D%/packages/patches/glibc-hurd-getauxval.patch		\
   %D%/packages/patches/glibc-hurd-gettyent.patch		\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index f95ae1b679..c5eac8a2da 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -795,26 +795,25 @@ (define-public glibc
   ;; version 2.28, GNU/Hurd used a different glibc branch.
   (package
    (name "glibc")
-   (version "2.35")
+   (version "2.38")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
             (sha256
              (base32
-              "0bpm1kfi09dxl4c6aanc5c9951fmf6ckkzay60cx7k37dcpp68si"))
+              "1lizxxqbfma5zgmcj0gk5iyk171f2nfvdhbv8rjrkcmjk24rk0pv"))
             (patches (search-patches "glibc-ldd-powerpc.patch"
-                                     "glibc-ldd-x86_64.patch"
+                                     "glibc-2.38-ldd-x86_64.patch"
                                      "glibc-dl-cache.patch"
-                                     "glibc-versioned-locpath.patch"
-                                     "glibc-allow-kernel-2.6.32.patch"
+                                     "glibc-2.37-versioned-locpath.patch"
+                                     ;; "glibc-allow-kernel-2.6.32.patch"
                                      "glibc-reinstate-prlimit64-fallback.patch"
                                      "glibc-supported-locales.patch"
-                                     "glibc-cross-objdump.patch"
-                                     "glibc-cross-objcopy.patch" ;must come 2nd
-                                     "glibc-hurd-clock_t_centiseconds.patch"
-                                     "glibc-hurd-clock_gettime_monotonic.patch"
+                                     "glibc-2.37-hurd-clock_t_centiseconds.patch"
+                                     "glibc-2.37-hurd-local-clock_gettime_MONOTONIC.patch"
                                      "glibc-hurd-mach-print.patch"
-                                     "glibc-hurd-gettyent.patch"))))
+                                     "glibc-hurd-gettyent.patch"
+                                     "glibc-hurd-getauxval.patch"))))
    (build-system gnu-build-system)
 
    ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
@@ -876,6 +875,10 @@ (define-public glibc
                                       "kernel-headers")
                            "/include")
 
+            ;; Libcrypt and <crypt.h> are deprecated in glibc 2.38 and not
+            ;; built by default.  Build it to reduce application breakage.
+            "--enable-crypt"
+
             ;; This is the default for most architectures as of GNU libc 2.26,
             ;; but we specify it explicitly for clarity and consistency.  See
             ;; "kernel-features.h" in the GNU libc for details.
@@ -1083,6 +1086,30 @@ (define-public glibc-for-fhs
 ;; 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-public glibc-2.35
+  (package
+    (inherit glibc)
+    (version "2.35")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
+              (sha256
+               (base32
+                "0bpm1kfi09dxl4c6aanc5c9951fmf6ckkzay60cx7k37dcpp68si"))
+              (patches (search-patches "glibc-ldd-powerpc.patch"
+                                       "glibc-ldd-x86_64.patch"
+                                       "glibc-dl-cache.patch"
+                                       "glibc-versioned-locpath.patch"
+                                       "glibc-allow-kernel-2.6.32.patch"
+                                       "glibc-reinstate-prlimit64-fallback.patch"
+                                       "glibc-supported-locales.patch"
+                                       "glibc-cross-objdump.patch"
+                                       "glibc-cross-objcopy.patch" ;must come 2nd
+                                       "glibc-hurd-clock_t_centiseconds.patch"
+                                       "glibc-hurd-clock_gettime_monotonic.patch"
+                                       "glibc-hurd-mach-print.patch"
+                                       "glibc-hurd-gettyent.patch"))))))
+
 (define-public glibc-2.33
   (package
     (inherit glibc)
diff --git a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
index 0acaeb1e46..8685f2c3b7 100644
--- a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
+++ b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
@@ -1,11 +1,3 @@
-From d73ba2caa10b8e9f51ff4239cc32eeb4e0de4279 Mon Sep 17 00:00:00 2001
-Message-Id: <d73ba2caa10b8e9f51ff4239cc32eeb4e0de4279.1683980025.git.dev@jpoiret.xyz>
-From: Josselin Poiret <dev@jpoiret.xyz>
-Date: Sat, 13 May 2023 14:10:43 +0200
-Subject: [PATCH] Add versioned locpath
-
-From: Josselin Poiret <dev@jpoiret.xyz>
-
 The format of locale data can be incompatible between libc versions, and
 loading incompatible data can lead to 'setlocale' returning EINVAL at best
 or triggering an assertion failure at worst.  See
@@ -20,20 +12,8 @@ that variable.  So, if GUIX_LOCPATH=/foo:/bar, locale data is searched for in
 That way, a single 'GUIX_LOCPATH' setting can work even if different libc
 versions coexist on the system.
 
-
-This patch is adapted from the 2.35 patch.
-
----
- locale/newlocale.c   | 15 ++--------
- locale/setlocale.c   | 68 +++++++++++++++++++++++++++++++++++++-------
- string/Makefile      |  1 +
- string/argz-suffix.c | 56 ++++++++++++++++++++++++++++++++++++
- string/argz.h        | 10 +++++++
- 5 files changed, 127 insertions(+), 23 deletions(-)
- create mode 100644 string/argz-suffix.c
-
 diff --git a/locale/newlocale.c b/locale/newlocale.c
-index 108d2428bf..6218e0fa77 100644
+index 108d2428..6218e0fa 100644
 --- a/locale/newlocale.c
 +++ b/locale/newlocale.c
 @@ -29,6 +29,7 @@
@@ -73,7 +53,7 @@ index 108d2428bf..6218e0fa77 100644
    /* Get the names for the locales we are interested in.  We either
       allow a composite name or a single name.  */
 diff --git a/locale/setlocale.c b/locale/setlocale.c
-index dd73fa4248..d8eb799384 100644
+index 6a902faa..2d07a644 100644
 --- a/locale/setlocale.c
 +++ b/locale/setlocale.c
 @@ -213,12 +213,65 @@ setdata (int category, struct __locale_data *data)
@@ -143,7 +123,7 @@ index dd73fa4248..d8eb799384 100644
    char *composite;
  
    /* Sanity check for CATEGORY argument.  */
-@@ -249,17 +302,10 @@ setlocale (int category, const char *locale)
+@@ -249,17 +308,10 @@ setlocale (int category, const char *locale)
    locale_path = NULL;
    locale_path_len = 0;
  
@@ -165,7 +145,7 @@ index dd73fa4248..d8eb799384 100644
  
    if (category == LC_ALL)
 diff --git a/string/Makefile b/string/Makefile
-index 3eced0d027..a7e68729ad 100644
+index 8cdfd5b0..6b0d606d 100644
 --- a/string/Makefile
 +++ b/string/Makefile
 @@ -51,6 +51,7 @@ routines := \
@@ -178,7 +158,7 @@ index 3eced0d027..a7e68729ad 100644
    bzero \
 diff --git a/string/argz-suffix.c b/string/argz-suffix.c
 new file mode 100644
-index 0000000000..505b0f248c
+index 00000000..505b0f24
 --- /dev/null
 +++ b/string/argz-suffix.c
 @@ -0,0 +1,56 @@
@@ -239,7 +219,7 @@ index 0000000000..505b0f248c
 +}
 +weak_alias (__argz_suffix_entries, argz_suffix_entries)
 diff --git a/string/argz.h b/string/argz.h
-index cbc588a8e6..bc6e484c9d 100644
+index cbc588a8..bc6e484c 100644
 --- a/string/argz.h
 +++ b/string/argz.h
 @@ -108,6 +108,16 @@ extern error_t argz_replace (char **__restrict __argz,
@@ -259,6 +239,3 @@ index cbc588a8e6..bc6e484c9d 100644
  \f
  /* Returns the next entry in ARGZ & ARGZ_LEN after ENTRY, or NULL if there
     are no more.  If entry is NULL, then the first entry is returned.  This
--- 
-2.40.1
-
diff --git a/gnu/packages/patches/glibc-2.38-ldd-x86_64.patch b/gnu/packages/patches/glibc-2.38-ldd-x86_64.patch
new file mode 100644
index 0000000000..9db412b5f2
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.38-ldd-x86_64.patch
@@ -0,0 +1,8 @@
+By default, 'RTDLLIST' in 'ldd' refers to 'lib64/ld-linux-x86-64.so', whereas
+it's in 'lib/' for us.  This patch fixes that.
+
+--- glibc-2.38/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
++++ glibc-2.38/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
+@@ -1 +1 @@
+-s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ 	]*$_\1"\2\4\6 \264\4-x86-64\6 \2x32\4-x32\6"_
++s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ 	]*$_\1"\2\4\6 \2\4-x86-64\6 \2x32\4-x32\6"_
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
  2023-12-07 10:19 [bug#67686] [PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
                   ` (2 preceding siblings ...)
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 3/5] DRAFT gnu: glibc: Update to 2.38 Ludovic Courtès
@ 2023-12-07 10:22 ` Ludovic Courtès
  2023-12-07 10:30   ` Ludovic Courtès
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 5/5] gnu: glibc: Ensure C.UTF-8 locale is always found Ludovic Courtès
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
  5 siblings, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 10:22 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

* gnu/packages/base.scm (glibc)[arguments]: Add ‘install-utf8-c-locale’
phase.
(glibc-2.35)[arguments]: Delete ‘install-utf8-c-locale’ phase.
(glibc-2.33, glibc-2.32, glibc-2.31): Inherit from ‘glibc-2.35’.

Change-Id: I7ba515184c7b7c40eaefd355639ffef8eeca66d8
---
 gnu/packages/base.scm | 31 +++++++++++++++++++++++++++----
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index c5eac8a2da..985cd627fe 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1023,6 +1023,21 @@ (define-public glibc
                                          (map (cut string-append slib "/" <>)
                                               files))))))
 
+                 (add-after 'install 'install-utf8-c-locale
+                   (lambda* (#:key outputs #:allow-other-keys)
+                     ;; Install the C.UTF-8 locale so there's always a UTF-8
+                     ;; locale around.
+                     (let* ((out (assoc-ref outputs "out"))
+                            (bin (string-append out "/bin"))
+                            (locale (string-append out "/lib/locale/"
+                                                   ,(package-version
+                                                     this-package))))
+                       (mkdir-p locale)
+                       (invoke (string-append bin "/localedef")
+                               "--no-archive" "--prefix" locale
+                               "-i" "C" "-f" "UTF-8"
+                               (string-append locale "/C.UTF-8")))))
+
                  ,@(if (target-hurd?)
                        '((add-after 'install 'augment-libc.so
                            (lambda* (#:key outputs #:allow-other-keys)
@@ -1108,11 +1123,19 @@ (define-public glibc-2.35
                                        "glibc-hurd-clock_t_centiseconds.patch"
                                        "glibc-hurd-clock_gettime_monotonic.patch"
                                        "glibc-hurd-mach-print.patch"
-                                       "glibc-hurd-gettyent.patch"))))))
+                                       "glibc-hurd-gettyent.patch"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments glibc)
+       ((#:phases phases)
+        ;; The C.UTF-8 fails to build in glibc 2.35:
+        ;; <https://sourceware.org/bugzilla/show_bug.cgi?id=28861>.
+        ;; It is missing altogether in versions earlier than 2.35.
+        `(modify-phases ,phases
+           (delete 'install-utf8-c-locale)))))))
 
 (define-public glibc-2.33
   (package
-    (inherit glibc)
+    (inherit glibc-2.35)
     (name "glibc")
     (version "2.33")
     (source (origin
@@ -1139,7 +1162,7 @@ (define-public glibc-2.33
 
 (define-public glibc-2.32
   (package
-    (inherit glibc)
+    (inherit glibc-2.35)
     (version "2.32")
     (source (origin
               (inherit (package-source glibc))
@@ -1194,7 +1217,7 @@ (define-public glibc-2.32
 
 (define-public glibc-2.31
   (package
-    (inherit glibc)
+    (inherit glibc-2.35)
     (version "2.31")
     (source (origin
               (inherit (package-source glibc))
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates 5/5] gnu: glibc: Ensure C.UTF-8 locale is always found.
  2023-12-07 10:19 [bug#67686] [PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
                   ` (3 preceding siblings ...)
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale Ludovic Courtès
@ 2023-12-07 10:22 ` Ludovic Courtès
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
  5 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 10:22 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

This change ensures that $prefix/lib/locale, which now contains C.UTF-8
data, is always searched.  Thus, “setlocale (LC_ALL, "C.UTF-8")” is
guaranteed to always succeed.

* gnu/packages/patches/glibc-2.37-versioned-locpath.patch: Adjust.

Change-Id: I6aaf2757da98e811aa55e0959126065537cd8970
---
 .../glibc-2.37-versioned-locpath.patch        | 22 ++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
index 8685f2c3b7..1f34292ad0 100644
--- a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
+++ b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
@@ -12,6 +12,20 @@ that variable.  So, if GUIX_LOCPATH=/foo:/bar, locale data is searched for in
 That way, a single 'GUIX_LOCPATH' setting can work even if different libc
 versions coexist on the system.
 
+diff --git a/locale/Makefile b/locale/Makefile
+index d7036b08..b5125166 100644
+--- a/locale/Makefile
++++ b/locale/Makefile
+@@ -94,7 +94,9 @@ localepath = "$(complocaledir):$(i18ndir)"
+ # -Iprograms doesn't really belong here, but this gets it at the head
+ # of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
+ # We need it before the standard -I's to see programs/config.h first.
++# Define 'LOCALEDIR' for use in 'compute_locale_search_path'.
+ locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \
++		  -DLOCALEDIR='"$(libdir)/locale"'     \
+ 		  -DLOCALE_ALIAS_PATH='"$(localedir)"' \
+ 		  -Iprograms
+ 
 diff --git a/locale/newlocale.c b/locale/newlocale.c
 index 108d2428..6218e0fa 100644
 --- a/locale/newlocale.c
@@ -56,7 +70,7 @@ diff --git a/locale/setlocale.c b/locale/setlocale.c
 index 6a902faa..2d07a644 100644
 --- a/locale/setlocale.c
 +++ b/locale/setlocale.c
-@@ -213,12 +213,65 @@ setdata (int category, struct __locale_data *data)
+@@ -213,12 +213,71 @@ setdata (int category, struct __locale_data *data)
      }
  }
  
@@ -104,6 +118,12 @@ index 6a902faa..2d07a644 100644
 +	goto bail_out;
 +    }
 +
++  /* Last, unconditionally append our own locale directory, which should
++     contain data for C.UTF-8.  */
++  if (__argz_add_sep (locale_path, locale_path_len,
++		      LOCALEDIR "/" VERSION, ':') != 0)
++    goto bail_out;
++
 +  return 0;
 +
 + bail_out:
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale Ludovic Courtès
@ 2023-12-07 10:30   ` Ludovic Courtès
  2023-12-07 20:31     ` Janneke Nieuwenhuizen
  2023-12-07 21:26     ` Ludovic Courtès
  0 siblings, 2 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 10:30 UTC (permalink / raw)
  To: 67686

Ludovic Courtès <ludo@gnu.org> skribis:

> +                     ;; Install the C.UTF-8 locale so there's always a UTF-8
> +                     ;; locale around.
> +                     (let* ((out (assoc-ref outputs "out"))
> +                            (bin (string-append out "/bin"))
> +                            (locale (string-append out "/lib/locale/"
> +                                                   ,(package-version
> +                                                     this-package))))
> +                       (mkdir-p locale)
> +                       (invoke (string-append bin "/localedef")
> +                               "--no-archive" "--prefix" locale
> +                               "-i" "C" "-f" "UTF-8"
> +                               (string-append locale "/C.UTF-8")))))

I realize now that this cannot work when cross-compiling, because the
this ‘localedef’ binary is not executable on the build machine.

I suspect libc builds an additional ‘localedef’ for the build machine
but I’m not sure where it is, hmm…

Ludo’.




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

* [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0.
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
@ 2023-12-07 20:11   ` Janneke Nieuwenhuizen
  2023-12-07 21:13     ` Ludovic Courtès
  0 siblings, 1 reply; 28+ messages in thread
From: Janneke Nieuwenhuizen @ 2023-12-07 20:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 67686, Greg Hogan

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

Ludovic Courtès writes:

> From: Greg Hogan <code@greghogan.com>
>
> * gnu/packages/gcc.scm (gcc-11): Update to 11.4.0.
> Remove ‘gcc-10-tree-sra-union-handling.patch’.
> * gnu/local.mk: Delist patch.
> * gnu/packages/patches/gcc-10-tree-sra-union-handling.patch: Delete.

[On core-updates] this patch is still used, I recommend the attatched
squash commit.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-squash-gnu-gcc-11-Update-to-11.4.0.patch --]
[-- Type: text/x-patch, Size: 2876 bytes --]

From aa0896545b283adc2c7451bbccca2b391a5affb8 Mon Sep 17 00:00:00 2001
Message-ID: <aa0896545b283adc2c7451bbccca2b391a5affb8.1701979835.git.janneke@gnu.org>
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Thu, 7 Dec 2023 21:04:31 +0100
Subject: [PATCH] squash! gnu: gcc@11: Update to 11.4.0.

Do not remove and delist this patch, it's still used by gcc-10.

* gnu/packages/patches/gcc-10-tree-sra-union-handling.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Change-Id: Iff8c9151326c87cb13db9c5b1a00c44b8eef95e3
---
 gnu/local.mk                                  |  1 +
 .../gcc-10-tree-sra-union-handling.patch      | 33 +++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 gnu/packages/patches/gcc-10-tree-sra-union-handling.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 7ecc828003..231488a1be 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1250,6 +1250,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-10-cross-environment-variables.patch \
   %D%/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch   \
   %D%/packages/patches/gcc-12-cross-environment-variables.patch \
+  %D%/packages/patches/gcc-10-tree-sra-union-handling.patch	\
   %D%/packages/patches/gcc-11-libstdc++-powerpc.patch           \
   %D%/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch	\
   %D%/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch	\
diff --git a/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch b/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch
new file mode 100644
index 0000000000..aae5fc9f72
--- /dev/null
+++ b/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch
@@ -0,0 +1,33 @@
+Fix a regression in GCC 10/11/12 where some union structures
+could get miscompiled when optimizations are enabled:
+
+  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105860
+
+Taken from upstream:
+
+  https://gcc.gnu.org/g:16afe2e2862f3dd93c711d7f8d436dee23c6c34d
+
+diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
+index 09d951a261b..420329f63f6 100644
+--- a/gcc/tree-sra.c
++++ b/gcc/tree-sra.c
+@@ -1647,7 +1647,18 @@ build_ref_for_offset (location_t loc, tree base, poly_int64 offset,
+ static tree
+ build_reconstructed_reference (location_t, tree base, struct access *model)
+ {
+-  tree expr = model->expr, prev_expr = NULL;
++  tree expr = model->expr;
++  /* We have to make sure to start just below the outermost union.  */
++  tree start_expr = expr;
++  while (handled_component_p (expr))
++    {
++      if (TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == UNION_TYPE)
++	start_expr = expr;
++      expr = TREE_OPERAND (expr, 0);
++    }
++
++  expr = start_expr;
++  tree prev_expr = NULL_TREE;
+   while (!types_compatible_p (TREE_TYPE (expr), TREE_TYPE (base)))
+     {
+       if (!handled_component_p (expr))

base-commit: 941456404cc52da9492836150cbcfa44f6a476e7
-- 
2.41.0


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


-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

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

* [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
  2023-12-07 10:30   ` Ludovic Courtès
@ 2023-12-07 20:31     ` Janneke Nieuwenhuizen
  2023-12-07 21:12       ` Ludovic Courtès
  2023-12-07 21:26     ` Ludovic Courtès
  1 sibling, 1 reply; 28+ messages in thread
From: Janneke Nieuwenhuizen @ 2023-12-07 20:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 67686

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

Ludovic Courtès writes:

Hello!

> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> +                     ;; Install the C.UTF-8 locale so there's always a UTF-8
>> +                     ;; locale around.
>> +                     (let* ((out (assoc-ref outputs "out"))
>> +                            (bin (string-append out "/bin"))
>> +                            (locale (string-append out "/lib/locale/"
>> +                                                   ,(package-version
>> +                                                     this-package))))
>> +                       (mkdir-p locale)
>> +                       (invoke (string-append bin "/localedef")
>> +                               "--no-archive" "--prefix" locale
>> +                               "-i" "C" "-f" "UTF-8"
>> +                               (string-append locale "/C.UTF-8")))))
>
> I realize now that this cannot work when cross-compiling, because the
> this ‘localedef’ binary is not executable on the build machine.
>
> I suspect libc builds an additional ‘localedef’ for the build machine
> but I’m not sure where it is, hmm…

So far, I haven't encountered this problem yet.

Trying to create a hurd image with this patch set, but mpfr fails for
me.

--8<---------------cut here---------------start------------->8---
======================================
   MPFR 4.2.0: tests/test-suite.log
======================================

# TOTAL: 197
# PASS:  196
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tsprintf
==============

Error in mpfr_vsprintf (s, "%0+ -'13.10Pd:", ...);
expected: "+01,234,567  :"
got:      "+0001,234,567:"
FAIL tsprintf (exit status: 1)
--8<---------------cut here---------------end--------------->8---

Updating to 4.2.1 (see attached patch) seems to fix it for me.

Greetings,
Janneke


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-mpfr-Update-to-4.2.1.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From e8b5a6c064b0395ca84749987c97dd9e1172b9ab Mon Sep 17 00:00:00 2001
Message-ID: <e8b5a6c064b0395ca84749987c97dd9e1172b9ab.1701980952.git.janneke@gnu.org>
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Thu, 7 Dec 2023 21:28:24 +0100
Subject: [PATCH] gnu: mpfr: Update to 4.2.1.

This fixes building mpfr with glibc-2.38.

* gnu/packages/multiprecision.scm (mpfr): Update to 4.2.1.

Change-Id: Ib8a8eecc9e72587e0fc1b8b0ee965aa274b85c7b
---
 gnu/packages/multiprecision.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index 3aa5dccfab..3d11523a07 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -120,13 +120,13 @@ (define-public gmp-6.0
 (define-public mpfr
   (package
    (name "mpfr")
-   (version "4.2.0")
+   (version "4.2.1")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/mpfr/mpfr-" version
                                 ".tar.xz"))
             (sha256 (base32
-                     "14yr4sf4mys64nzbgnd997l6l4n8l9vsjnnvnb0lh4jh2ggpi8q6"))))
+                     "1cnb3y7y351qg6r7ynwsgaykm7l2a8zg2nlljs4rf9k778shfy17"))))
    (arguments
     (list
      #:phases (if (system-hurd?)

base-commit: 36a126b0580a2d3e01704db7bbe4c3c0da8356d3
-- 
2.41.0


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


-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

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

* [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
  2023-12-07 20:31     ` Janneke Nieuwenhuizen
@ 2023-12-07 21:12       ` Ludovic Courtès
  0 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 21:12 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen; +Cc: 67686

Hi!

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

>>From e8b5a6c064b0395ca84749987c97dd9e1172b9ab Mon Sep 17 00:00:00 2001
> Message-ID: <e8b5a6c064b0395ca84749987c97dd9e1172b9ab.1701980952.git.janneke@gnu.org>
> From: Janneke Nieuwenhuizen <janneke@gnu.org>
> Date: Thu, 7 Dec 2023 21:28:24 +0100
> Subject: [PATCH] gnu: mpfr: Update to 4.2.1.
>
> This fixes building mpfr with glibc-2.38.
>
> * gnu/packages/multiprecision.scm (mpfr): Update to 4.2.1.
>
> Change-Id: Ib8a8eecc9e72587e0fc1b8b0ee965aa274b85c7b

Excellent, I added it to my branch (so we can eventually push the whole
thing at once.)

Thanks!

Ludo’.




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

* [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0.
  2023-12-07 20:11   ` Janneke Nieuwenhuizen
@ 2023-12-07 21:13     ` Ludovic Courtès
  0 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 21:13 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen; +Cc: 67686, Greg Hogan

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

>>From aa0896545b283adc2c7451bbccca2b391a5affb8 Mon Sep 17 00:00:00 2001
> Message-ID: <aa0896545b283adc2c7451bbccca2b391a5affb8.1701979835.git.janneke@gnu.org>
> From: Janneke Nieuwenhuizen <janneke@gnu.org>
> Date: Thu, 7 Dec 2023 21:04:31 +0100
> Subject: [PATCH] squash! gnu: gcc@11: Update to 11.4.0.
>
> Do not remove and delist this patch, it's still used by gcc-10.
>
> * gnu/packages/patches/gcc-10-tree-sra-union-handling.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
>
> Change-Id: Iff8c9151326c87cb13db9c5b1a00c44b8eef95e3

Good catch, added!

Ludo’.




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

* [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
  2023-12-07 10:30   ` Ludovic Courtès
  2023-12-07 20:31     ` Janneke Nieuwenhuizen
@ 2023-12-07 21:26     ` Ludovic Courtès
  2023-12-09 16:33       ` Efraim Flashner
  1 sibling, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 21:26 UTC (permalink / raw)
  To: 67686; +Cc: Efraim Flashner

Ludovic Courtès <ludo@gnu.org> skribis:

> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> +                     ;; Install the C.UTF-8 locale so there's always a UTF-8
>> +                     ;; locale around.
>> +                     (let* ((out (assoc-ref outputs "out"))
>> +                            (bin (string-append out "/bin"))
>> +                            (locale (string-append out "/lib/locale/"
>> +                                                   ,(package-version
>> +                                                     this-package))))
>> +                       (mkdir-p locale)
>> +                       (invoke (string-append bin "/localedef")
>> +                               "--no-archive" "--prefix" locale
>> +                               "-i" "C" "-f" "UTF-8"
>> +                               (string-append locale "/C.UTF-8")))))
>
> I realize now that this cannot work when cross-compiling, because the
> this ‘localedef’ binary is not executable on the build machine.
>
> I suspect libc builds an additional ‘localedef’ for the build machine
> but I’m not sure where it is, hmm…

I was told on #glibc that (1) there’s no ‘localedef’ for the build
machine produced during cross-compilation, and (2) that more generally,
there’s no way to cross-build locale data, that endianness and other
things may matter.

I suspect #2 was about the locale archive and not locale data, because
evidence suggests that locale data is system-independent:

--8<---------------cut here---------------start------------->8---
$ for s in aarch64-linux powerpc64le-linux armhf-linux i686-linux ; do diff -r $(guix build glibc-locales@2.35) $(guix build glibc-locales@2.35 -s "$s") && echo "$s same as x86_64-linux" ; done
aarch64-linux same as x86_64-linux
powerpc64le-linux same as x86_64-linux
armhf-linux same as x86_64-linux
i686-linux same as x86_64-linux
$ guix describe
  guix 6e2dd51
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 6e2dd51df5f3f51e9056dd4f2e1b036195ab3caa
--8<---------------cut here---------------end--------------->8---

Efraim, could you check against powerpc-linux, which is the only
big-endian target we +/- support?

Ludo’.




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

* [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available
  2023-12-07 10:19 [bug#67686] [PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
                   ` (4 preceding siblings ...)
  2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 5/5] gnu: glibc: Ensure C.UTF-8 locale is always found Ludovic Courtès
@ 2023-12-07 22:54 ` Ludovic Courtès
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 1/7] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
                     ` (7 more replies)
  5 siblings, 8 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 22:54 UTC (permalink / raw)
  To: 67686
  Cc: Ludovic Courtès, Christopher Baines, Josselin Poiret,
	Mathieu Othacehe, Ricardo Wurmus, Tobias Geerinckx-Rice,
	Efraim Flashner, Ludovic Courtès, Janneke Nieuwenhuizen

Changes since v1:

  • The ‘install-utf8-c-locale’ phase now installs nothing when
    cross-compiling.

    Eventually, I’d like to (1) change the package to use gexps,
    and (2) use the native ‘localedef’ from ‘this-package’ to
    build locales when cross-compiling as this appears to do
    the job.

  • Incorporated the GCC and MPFR patches by Janneke.

(Since we haven’t yet added a ‘core-packages’ team, I’m seeing
people likely to be interested.  :-))

Ludo’.

Greg Hogan (1):
  gnu: gcc@11: Update to 11.4.0.

Janneke Nieuwenhuizen (1):
  gnu: mpfr: Update to 4.2.1.

Ludovic Courtès (5):
  gnu: glibc-utf8-locales: Generalize and use gexps.
  DRAFT gnu: glibc: Update to 2.38.
  gnu: glibc: Install C.UTF-8 locale.
  gnu: glibc: Ensure C.UTF-8 locale is always found.
  gnu: glibc: Improve handling of empty .a files.

 gnu/local.mk                                  |   1 +
 gnu/packages/base.scm                         | 166 ++++++++++++------
 gnu/packages/commencement.scm                 |  10 +-
 gnu/packages/gcc.scm                          |   7 +-
 gnu/packages/multiprecision.scm               |   4 +-
 .../glibc-2.37-versioned-locpath.patch        |  57 +++---
 .../patches/glibc-2.38-ldd-x86_64.patch       |   8 +
 7 files changed, 152 insertions(+), 101 deletions(-)
 create mode 100644 gnu/packages/patches/glibc-2.38-ldd-x86_64.patch


base-commit: 69d31a158001f2cb97983bd13f4575f6c9484451
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates v2 1/7] gnu: gcc@11: Update to 11.4.0.
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
@ 2023-12-07 22:54   ` Ludovic Courtès
  2023-12-08 17:39     ` Janneke Nieuwenhuizen
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 2/7] gnu: glibc-utf8-locales: Generalize and use gexps Ludovic Courtès
                     ` (6 subsequent siblings)
  7 siblings, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 22:54 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès, Greg Hogan, Janneke Nieuwenhuizen

From: Greg Hogan <code@greghogan.com>

* gnu/packages/gcc.scm (gcc-11): Update to 11.4.0.
Remove ‘gcc-10-tree-sra-union-handling.patch’.

Change-Id: Iff8c9151326c87cb13db9c5b1a00c44b8eef95e3
Co-authored-by: Janneke Nieuwenhuizen <janneke@gnu.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/packages/gcc.scm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 3137fe2d75..313a92d8aa 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -719,17 +719,16 @@ (define-public gcc-10
 (define-public gcc-11
   (package
    (inherit gcc-8)
-   (version "11.3.0")
+   (version "11.4.0")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/gcc/gcc-"
                                 version "/gcc-" version ".tar.xz"))
             (sha256
              (base32
-              "0fdclcwf728wbq52vphfcjywzhpsjp3kifzj3pib3xcihs0z4z5l"))
+              "1ncd7akww0hl5kkmw1dj3qgqp3phdrr5dfnm7jia9s07n0ib4b9z"))
             (patches (search-patches "gcc-9-strmov-store-file-names.patch"
-                                     "gcc-5.0-libvtv-runpath.patch"
-                                     "gcc-10-tree-sra-union-handling.patch"))
+                                     "gcc-5.0-libvtv-runpath.patch"))
             (modules '((guix build utils)))
             (snippet gcc-canadian-cross-objdump-snippet)))
    (arguments
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates v2 2/7] gnu: glibc-utf8-locales: Generalize and use gexps.
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 1/7] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
@ 2023-12-07 22:54   ` Ludovic Courtès
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 3/7] gnu: mpfr: Update to 4.2.1 Ludovic Courtès
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 22:54 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

Previously code was dependent on the ‘name’ field of the GLIBC package.

* gnu/packages/base.scm (make-glibc-utf8-locales): Use gexps.  Replace
references to ‘%build-inputs’ by calls to ‘which’.  Replace reference to
‘version’ by (package-version this-package).

Change-Id: I1e7003047aa85df74069b233191ab331b5f887b6
---
 gnu/packages/base.scm | 67 +++++++++++++++++++++++--------------------
 1 file changed, 36 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index b4982107b2..f95ae1b679 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1348,47 +1348,52 @@ (define %default-utf8-locales
 (define*-public (make-glibc-utf8-locales glibc #:key
                                          (locales %default-utf8-locales)
                                          (name "glibc-utf8-locales"))
-  (define default-locales? (equal? locales %default-utf8-locales))
+  (define default-locales?
+    (equal? locales %default-utf8-locales))
+
   (package
     (name name)
     (version (package-version glibc))
     (source #f)
     (build-system trivial-build-system)
     (arguments
-     `(#:modules ((guix build utils))
-       #:builder (begin
-                   (use-modules (guix build utils))
+     (list #:modules '((guix build utils))
+           #:builder
+           #~(begin
+               (use-modules (guix build utils))
 
-                   (let* ((libc      (assoc-ref %build-inputs "glibc"))
-                          (gzip      (assoc-ref %build-inputs "gzip"))
-                          (out       (assoc-ref %outputs "out"))
-                          (localedir (string-append out "/lib/locale/"
-                                                    ,(version-major+minor version))))
-                     ;; 'localedef' needs 'gzip'.
-                     (setenv "PATH" (string-append libc "/bin:" gzip "/bin"))
+               (let* ((libc      (dirname
+                                  (search-input-file %build-inputs
+                                                     "/bin/localedef")))
+                      (gzip      (dirname
+                                  (search-input-file %build-inputs
+                                                     "/bin/gzip")))
+                      (out       #$output)
+                      (localedir (string-append out "/lib/locale/"
+                                                #$(version-major+minor
+                                                   (package-version this-package)))))
+                 ;; 'localedef' needs 'gzip'.
+                 (setenv "PATH" (string-append libc ":" gzip ""))
 
-                     (mkdir-p localedir)
-                     (for-each (lambda (locale)
-                                 (define file
-                                   ;; Use the "normalized codeset" by
-                                   ;; default--e.g., "en_US.utf8".
-                                   (string-append localedir "/" locale ".utf8"))
+                 (mkdir-p localedir)
+                 (for-each (lambda (locale)
+                             (define file
+                               ;; Use the "normalized codeset" by
+                               ;; default--e.g., "en_US.utf8".
+                               (string-append localedir "/" locale ".utf8"))
 
-                                 (invoke "localedef" "--no-archive"
-                                         "--prefix" localedir
-                                         "-i" locale
-                                         "-f" "UTF-8" file)
+                             (invoke "localedef" "--no-archive"
+                                     "--prefix" localedir
+                                     "-i" locale
+                                     "-f" "UTF-8" file)
 
-                                 ;; For backward compatibility with Guix
-                                 ;; <= 0.8.3, add "xx_YY.UTF-8".
-                                 (symlink (string-append locale ".utf8")
-                                          (string-append localedir "/"
-                                                         locale ".UTF-8")))
-                               ',locales)
-                     #t))))
-    (native-inputs
-     `(("glibc" ,glibc)
-       ("gzip" ,gzip)))
+                             ;; For backward compatibility with Guix
+                             ;; <= 0.8.3, add "xx_YY.UTF-8".
+                             (symlink (string-append locale ".utf8")
+                                      (string-append localedir "/"
+                                                     locale ".UTF-8")))
+                           '#$locales)))))
+    (native-inputs (list glibc gzip))
     (synopsis (if default-locales?
                   (P_ "Small sample of UTF-8 locales")
                   (P_ "Customized sample of UTF-8 locales")))
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates v2 3/7] gnu: mpfr: Update to 4.2.1.
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 1/7] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 2/7] gnu: glibc-utf8-locales: Generalize and use gexps Ludovic Courtès
@ 2023-12-07 22:54   ` Ludovic Courtès
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38 Ludovic Courtès
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 22:54 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès, Janneke Nieuwenhuizen

From: Janneke Nieuwenhuizen <janneke@gnu.org>

This fixes building mpfr with glibc-2.38.

* gnu/packages/multiprecision.scm (mpfr): Update to 4.2.1.

Change-Id: Ib8a8eecc9e72587e0fc1b8b0ee965aa274b85c7b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/packages/multiprecision.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index 3aa5dccfab..3d11523a07 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -120,13 +120,13 @@ (define-public gmp-6.0
 (define-public mpfr
   (package
    (name "mpfr")
-   (version "4.2.0")
+   (version "4.2.1")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/mpfr/mpfr-" version
                                 ".tar.xz"))
             (sha256 (base32
-                     "14yr4sf4mys64nzbgnd997l6l4n8l9vsjnnvnb0lh4jh2ggpi8q6"))))
+                     "1cnb3y7y351qg6r7ynwsgaykm7l2a8zg2nlljs4rf9k778shfy17"))))
    (arguments
     (list
      #:phases (if (system-hurd?)
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38.
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
                     ` (2 preceding siblings ...)
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 3/7] gnu: mpfr: Update to 4.2.1 Ludovic Courtès
@ 2023-12-07 22:54   ` Ludovic Courtès
  2023-12-09 21:44     ` Ludovic Courtès
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 5/7] gnu: glibc: Install C.UTF-8 locale Ludovic Courtès
                     ` (3 subsequent siblings)
  7 siblings, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 22:54 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

DRAFT: Two questions:

  1. Can we abandon ‘glibc-allow-kernel-2.6.32’ (CentOS 6)?

  2. Check cross-compilation.

* gnu/packages/patches/glibc-2.38-ldd-x86_64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/base.scm (glibc): Update to 2.38.
[source]: Adjust list of patches.
[arguments]: Add ‘--enable-crypt’.
(glibc-2.35): New variable.

Change-Id: I040b724c47d2ee5f90f2deb03a4828e79d1bfc4e
---
 gnu/local.mk                                  |  1 +
 gnu/packages/base.scm                         | 47 +++++++++++++++----
 .../glibc-2.37-versioned-locpath.patch        | 35 +++-----------
 .../patches/glibc-2.38-ldd-x86_64.patch       |  8 ++++
 4 files changed, 52 insertions(+), 39 deletions(-)
 create mode 100644 gnu/packages/patches/glibc-2.38-ldd-x86_64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ce850c9f7e..231488a1be 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1305,6 +1305,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/glibc-2.37-hurd-clock_t_centiseconds.patch	\
   %D%/packages/patches/glibc-2.37-hurd-local-clock_gettime_MONOTONIC.patch	\
   %D%/packages/patches/glibc-2.37-versioned-locpath.patch	\
+  %D%/packages/patches/glibc-2.38-ldd-x86_64.patch		\
   %D%/packages/patches/glibc-hurd-clock_t_centiseconds.patch	\
   %D%/packages/patches/glibc-hurd-getauxval.patch		\
   %D%/packages/patches/glibc-hurd-gettyent.patch		\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index f95ae1b679..c5eac8a2da 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -795,26 +795,25 @@ (define-public glibc
   ;; version 2.28, GNU/Hurd used a different glibc branch.
   (package
    (name "glibc")
-   (version "2.35")
+   (version "2.38")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
             (sha256
              (base32
-              "0bpm1kfi09dxl4c6aanc5c9951fmf6ckkzay60cx7k37dcpp68si"))
+              "1lizxxqbfma5zgmcj0gk5iyk171f2nfvdhbv8rjrkcmjk24rk0pv"))
             (patches (search-patches "glibc-ldd-powerpc.patch"
-                                     "glibc-ldd-x86_64.patch"
+                                     "glibc-2.38-ldd-x86_64.patch"
                                      "glibc-dl-cache.patch"
-                                     "glibc-versioned-locpath.patch"
-                                     "glibc-allow-kernel-2.6.32.patch"
+                                     "glibc-2.37-versioned-locpath.patch"
+                                     ;; "glibc-allow-kernel-2.6.32.patch"
                                      "glibc-reinstate-prlimit64-fallback.patch"
                                      "glibc-supported-locales.patch"
-                                     "glibc-cross-objdump.patch"
-                                     "glibc-cross-objcopy.patch" ;must come 2nd
-                                     "glibc-hurd-clock_t_centiseconds.patch"
-                                     "glibc-hurd-clock_gettime_monotonic.patch"
+                                     "glibc-2.37-hurd-clock_t_centiseconds.patch"
+                                     "glibc-2.37-hurd-local-clock_gettime_MONOTONIC.patch"
                                      "glibc-hurd-mach-print.patch"
-                                     "glibc-hurd-gettyent.patch"))))
+                                     "glibc-hurd-gettyent.patch"
+                                     "glibc-hurd-getauxval.patch"))))
    (build-system gnu-build-system)
 
    ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
@@ -876,6 +875,10 @@ (define-public glibc
                                       "kernel-headers")
                            "/include")
 
+            ;; Libcrypt and <crypt.h> are deprecated in glibc 2.38 and not
+            ;; built by default.  Build it to reduce application breakage.
+            "--enable-crypt"
+
             ;; This is the default for most architectures as of GNU libc 2.26,
             ;; but we specify it explicitly for clarity and consistency.  See
             ;; "kernel-features.h" in the GNU libc for details.
@@ -1083,6 +1086,30 @@ (define-public glibc-for-fhs
 ;; 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-public glibc-2.35
+  (package
+    (inherit glibc)
+    (version "2.35")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
+              (sha256
+               (base32
+                "0bpm1kfi09dxl4c6aanc5c9951fmf6ckkzay60cx7k37dcpp68si"))
+              (patches (search-patches "glibc-ldd-powerpc.patch"
+                                       "glibc-ldd-x86_64.patch"
+                                       "glibc-dl-cache.patch"
+                                       "glibc-versioned-locpath.patch"
+                                       "glibc-allow-kernel-2.6.32.patch"
+                                       "glibc-reinstate-prlimit64-fallback.patch"
+                                       "glibc-supported-locales.patch"
+                                       "glibc-cross-objdump.patch"
+                                       "glibc-cross-objcopy.patch" ;must come 2nd
+                                       "glibc-hurd-clock_t_centiseconds.patch"
+                                       "glibc-hurd-clock_gettime_monotonic.patch"
+                                       "glibc-hurd-mach-print.patch"
+                                       "glibc-hurd-gettyent.patch"))))))
+
 (define-public glibc-2.33
   (package
     (inherit glibc)
diff --git a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
index 0acaeb1e46..8685f2c3b7 100644
--- a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
+++ b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
@@ -1,11 +1,3 @@
-From d73ba2caa10b8e9f51ff4239cc32eeb4e0de4279 Mon Sep 17 00:00:00 2001
-Message-Id: <d73ba2caa10b8e9f51ff4239cc32eeb4e0de4279.1683980025.git.dev@jpoiret.xyz>
-From: Josselin Poiret <dev@jpoiret.xyz>
-Date: Sat, 13 May 2023 14:10:43 +0200
-Subject: [PATCH] Add versioned locpath
-
-From: Josselin Poiret <dev@jpoiret.xyz>
-
 The format of locale data can be incompatible between libc versions, and
 loading incompatible data can lead to 'setlocale' returning EINVAL at best
 or triggering an assertion failure at worst.  See
@@ -20,20 +12,8 @@ that variable.  So, if GUIX_LOCPATH=/foo:/bar, locale data is searched for in
 That way, a single 'GUIX_LOCPATH' setting can work even if different libc
 versions coexist on the system.
 
-
-This patch is adapted from the 2.35 patch.
-
----
- locale/newlocale.c   | 15 ++--------
- locale/setlocale.c   | 68 +++++++++++++++++++++++++++++++++++++-------
- string/Makefile      |  1 +
- string/argz-suffix.c | 56 ++++++++++++++++++++++++++++++++++++
- string/argz.h        | 10 +++++++
- 5 files changed, 127 insertions(+), 23 deletions(-)
- create mode 100644 string/argz-suffix.c
-
 diff --git a/locale/newlocale.c b/locale/newlocale.c
-index 108d2428bf..6218e0fa77 100644
+index 108d2428..6218e0fa 100644
 --- a/locale/newlocale.c
 +++ b/locale/newlocale.c
 @@ -29,6 +29,7 @@
@@ -73,7 +53,7 @@ index 108d2428bf..6218e0fa77 100644
    /* Get the names for the locales we are interested in.  We either
       allow a composite name or a single name.  */
 diff --git a/locale/setlocale.c b/locale/setlocale.c
-index dd73fa4248..d8eb799384 100644
+index 6a902faa..2d07a644 100644
 --- a/locale/setlocale.c
 +++ b/locale/setlocale.c
 @@ -213,12 +213,65 @@ setdata (int category, struct __locale_data *data)
@@ -143,7 +123,7 @@ index dd73fa4248..d8eb799384 100644
    char *composite;
  
    /* Sanity check for CATEGORY argument.  */
-@@ -249,17 +302,10 @@ setlocale (int category, const char *locale)
+@@ -249,17 +308,10 @@ setlocale (int category, const char *locale)
    locale_path = NULL;
    locale_path_len = 0;
  
@@ -165,7 +145,7 @@ index dd73fa4248..d8eb799384 100644
  
    if (category == LC_ALL)
 diff --git a/string/Makefile b/string/Makefile
-index 3eced0d027..a7e68729ad 100644
+index 8cdfd5b0..6b0d606d 100644
 --- a/string/Makefile
 +++ b/string/Makefile
 @@ -51,6 +51,7 @@ routines := \
@@ -178,7 +158,7 @@ index 3eced0d027..a7e68729ad 100644
    bzero \
 diff --git a/string/argz-suffix.c b/string/argz-suffix.c
 new file mode 100644
-index 0000000000..505b0f248c
+index 00000000..505b0f24
 --- /dev/null
 +++ b/string/argz-suffix.c
 @@ -0,0 +1,56 @@
@@ -239,7 +219,7 @@ index 0000000000..505b0f248c
 +}
 +weak_alias (__argz_suffix_entries, argz_suffix_entries)
 diff --git a/string/argz.h b/string/argz.h
-index cbc588a8e6..bc6e484c9d 100644
+index cbc588a8..bc6e484c 100644
 --- a/string/argz.h
 +++ b/string/argz.h
 @@ -108,6 +108,16 @@ extern error_t argz_replace (char **__restrict __argz,
@@ -259,6 +239,3 @@ index cbc588a8e6..bc6e484c9d 100644
  \f
  /* Returns the next entry in ARGZ & ARGZ_LEN after ENTRY, or NULL if there
     are no more.  If entry is NULL, then the first entry is returned.  This
--- 
-2.40.1
-
diff --git a/gnu/packages/patches/glibc-2.38-ldd-x86_64.patch b/gnu/packages/patches/glibc-2.38-ldd-x86_64.patch
new file mode 100644
index 0000000000..9db412b5f2
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.38-ldd-x86_64.patch
@@ -0,0 +1,8 @@
+By default, 'RTDLLIST' in 'ldd' refers to 'lib64/ld-linux-x86-64.so', whereas
+it's in 'lib/' for us.  This patch fixes that.
+
+--- glibc-2.38/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
++++ glibc-2.38/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
+@@ -1 +1 @@
+-s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ 	]*$_\1"\2\4\6 \264\4-x86-64\6 \2x32\4-x32\6"_
++s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ 	]*$_\1"\2\4\6 \2\4-x86-64\6 \2x32\4-x32\6"_
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates v2 5/7] gnu: glibc: Install C.UTF-8 locale.
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
                     ` (3 preceding siblings ...)
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38 Ludovic Courtès
@ 2023-12-07 22:54   ` Ludovic Courtès
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 6/7] gnu: glibc: Ensure C.UTF-8 locale is always found Ludovic Courtès
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 22:54 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

* gnu/packages/base.scm (glibc)[arguments]: Add ‘install-utf8-c-locale’
phase.
(glibc-2.35)[arguments]: Delete ‘install-utf8-c-locale’ phase.
(glibc-2.33, glibc-2.32, glibc-2.31): Inherit from ‘glibc-2.35’.

Change-Id: I7ba515184c7b7c40eaefd355639ffef8eeca66d8
---
 gnu/packages/base.scm | 36 ++++++++++++++++++++++++++++++++----
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index c5eac8a2da..1144110309 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1023,6 +1023,26 @@ (define-public glibc
                                          (map (cut string-append slib "/" <>)
                                               files))))))
 
+                 (add-after 'install 'install-utf8-c-locale
+                   (lambda* (#:key outputs #:allow-other-keys)
+                     ;; Install the C.UTF-8 locale so there's always a UTF-8
+                     ;; locale around.
+                     (let* ((out (assoc-ref outputs "out"))
+                            (bin (string-append out "/bin"))
+                            (locale (string-append out "/lib/locale/"
+                                                   ,(package-version
+                                                     this-package))))
+                       (mkdir-p locale)
+
+                       ;; FIXME: When cross-compiling, attempt to use
+                       ;; 'localedef' from the same libc version.
+                       (invoke ,(if (%current-target-system)
+                                    "true"
+                                    '(string-append bin "/localedef"))
+                               "--no-archive" "--prefix" locale
+                               "-i" "C" "-f" "UTF-8"
+                               (string-append locale "/C.UTF-8")))))
+
                  ,@(if (target-hurd?)
                        '((add-after 'install 'augment-libc.so
                            (lambda* (#:key outputs #:allow-other-keys)
@@ -1108,11 +1128,19 @@ (define-public glibc-2.35
                                        "glibc-hurd-clock_t_centiseconds.patch"
                                        "glibc-hurd-clock_gettime_monotonic.patch"
                                        "glibc-hurd-mach-print.patch"
-                                       "glibc-hurd-gettyent.patch"))))))
+                                       "glibc-hurd-gettyent.patch"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments glibc)
+       ((#:phases phases)
+        ;; The C.UTF-8 fails to build in glibc 2.35:
+        ;; <https://sourceware.org/bugzilla/show_bug.cgi?id=28861>.
+        ;; It is missing altogether in versions earlier than 2.35.
+        `(modify-phases ,phases
+           (delete 'install-utf8-c-locale)))))))
 
 (define-public glibc-2.33
   (package
-    (inherit glibc)
+    (inherit glibc-2.35)
     (name "glibc")
     (version "2.33")
     (source (origin
@@ -1139,7 +1167,7 @@ (define-public glibc-2.33
 
 (define-public glibc-2.32
   (package
-    (inherit glibc)
+    (inherit glibc-2.35)
     (version "2.32")
     (source (origin
               (inherit (package-source glibc))
@@ -1194,7 +1222,7 @@ (define-public glibc-2.32
 
 (define-public glibc-2.31
   (package
-    (inherit glibc)
+    (inherit glibc-2.35)
     (version "2.31")
     (source (origin
               (inherit (package-source glibc))
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates v2 6/7] gnu: glibc: Ensure C.UTF-8 locale is always found.
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
                     ` (4 preceding siblings ...)
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 5/7] gnu: glibc: Install C.UTF-8 locale Ludovic Courtès
@ 2023-12-07 22:54   ` Ludovic Courtès
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 7/7] gnu: glibc: Improve handling of empty .a files Ludovic Courtès
  2023-12-09 14:58   ` bug#67686: [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
  7 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 22:54 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

This change ensures that $prefix/lib/locale, which now contains C.UTF-8
data, is always searched.  Thus, “setlocale (LC_ALL, "C.UTF-8")” is
guaranteed to always succeed.

* gnu/packages/patches/glibc-2.37-versioned-locpath.patch: Adjust.

Change-Id: I6aaf2757da98e811aa55e0959126065537cd8970
---
 .../glibc-2.37-versioned-locpath.patch        | 22 ++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
index 8685f2c3b7..1f34292ad0 100644
--- a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
+++ b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
@@ -12,6 +12,20 @@ that variable.  So, if GUIX_LOCPATH=/foo:/bar, locale data is searched for in
 That way, a single 'GUIX_LOCPATH' setting can work even if different libc
 versions coexist on the system.
 
+diff --git a/locale/Makefile b/locale/Makefile
+index d7036b08..b5125166 100644
+--- a/locale/Makefile
++++ b/locale/Makefile
+@@ -94,7 +94,9 @@ localepath = "$(complocaledir):$(i18ndir)"
+ # -Iprograms doesn't really belong here, but this gets it at the head
+ # of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
+ # We need it before the standard -I's to see programs/config.h first.
++# Define 'LOCALEDIR' for use in 'compute_locale_search_path'.
+ locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \
++		  -DLOCALEDIR='"$(libdir)/locale"'     \
+ 		  -DLOCALE_ALIAS_PATH='"$(localedir)"' \
+ 		  -Iprograms
+ 
 diff --git a/locale/newlocale.c b/locale/newlocale.c
 index 108d2428..6218e0fa 100644
 --- a/locale/newlocale.c
@@ -56,7 +70,7 @@ diff --git a/locale/setlocale.c b/locale/setlocale.c
 index 6a902faa..2d07a644 100644
 --- a/locale/setlocale.c
 +++ b/locale/setlocale.c
-@@ -213,12 +213,65 @@ setdata (int category, struct __locale_data *data)
+@@ -213,12 +213,71 @@ setdata (int category, struct __locale_data *data)
      }
  }
  
@@ -104,6 +118,12 @@ index 6a902faa..2d07a644 100644
 +	goto bail_out;
 +    }
 +
++  /* Last, unconditionally append our own locale directory, which should
++     contain data for C.UTF-8.  */
++  if (__argz_add_sep (locale_path, locale_path_len,
++		      LOCALEDIR "/" VERSION, ':') != 0)
++    goto bail_out;
++
 +  return 0;
 +
 + bail_out:
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates v2 7/7] gnu: glibc: Improve handling of empty .a files.
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
                     ` (5 preceding siblings ...)
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 6/7] gnu: glibc: Ensure C.UTF-8 locale is always found Ludovic Courtès
@ 2023-12-07 22:54   ` Ludovic Courtès
  2023-12-09 14:58   ` bug#67686: [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
  7 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-07 22:54 UTC (permalink / raw)
  To: 67686; +Cc: Ludovic Courtès

This partially reverts 3b2de6529b9d77c8a74d431859a3ec334e9603c2, itself
a followup to 25b30622b4a77cd4b2965b9d62fa310a22413d54.

* gnu/packages/base.scm (glibc)[arguments]: In ‘move-static-libs’ phase,
remove ‘empty-static-libraries’ variable and rewrite
‘empty-static-library?’ to check file type and size.
* gnu/packages/commencement.scm (make-gcc-toolchain): Remove ‘copy-file’
call to create ‘librt.a’.

Change-Id: I33c6825d5b1e6e790dfff494bac1da07d3389e77
---
 gnu/packages/base.scm         | 18 ++++++------------
 gnu/packages/commencement.scm | 10 +---------
 2 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 1144110309..311d598c8e 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -968,19 +968,13 @@ (define-public glibc
                      ;; and as such, it is useful to have these ".a" files in
                      ;; OUT in addition to STATIC.
 
-                     ;; XXX: It might be better to determine whether a static
-                     ;; library is empty by some criterion (such as their file
-                     ;; size equaling eight bytes) rather than hardcoding them
-                     ;; by name.
-
-                     ;; XXX: We forgot librt.a for the current version!  In
-                     ;; the meantime, gcc-toolchain provides it, but remove
-                     ;; that fix once librt.a is added here.
-                     (define empty-static-libraries
-                       '("libpthread.a" "libdl.a" "libutil.a" "libanl.a"))
                      (define (empty-static-library? file)
-                       (any (lambda (s)
-                              (string=? file s)) empty-static-libraries))
+                       ;; Return true if FILE is an 'ar' archive with nothing
+                       ;; beyond the header.
+                       (let ((file (string-append (assoc-ref outputs "out")
+                                                  "/lib/" file)))
+                         (and (ar-file? file)
+                              (= (stat:size (stat file)) 8))))
 
                      (define (static-library? file)
                        ;; Return true if FILE is a static library.  The
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 4ccbbb0881..6c0f295f30 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3569,15 +3569,7 @@ (define* (make-gcc-toolchain gcc
                                                      "libc-debug")))
                        (union-build (assoc-ref %outputs "static")
                                     (list (assoc-ref %build-inputs
-                                                     "libc-static")))
-                       ;; XXX Remove once an empty librt.a is added to
-                       ;; libc:out.
-                       (copy-file
-                        (string-append (assoc-ref %outputs "out")
-                                       "/lib/libpthread.a")
-                        (string-append (assoc-ref %outputs "out")
-                                       "/lib/librt.a"))
-                       #t))))
+                                                     "libc-static")))))))
 
       (native-search-paths
        (append (package-native-search-paths gcc)
-- 
2.41.0





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

* [bug#67686] [PATCH core-updates v2 1/7] gnu: gcc@11: Update to 11.4.0.
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 1/7] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
@ 2023-12-08 17:39     ` Janneke Nieuwenhuizen
  0 siblings, 0 replies; 28+ messages in thread
From: Janneke Nieuwenhuizen @ 2023-12-08 17:39 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 67686, Josselin Poiret

Ludovic Courtès writes:

Hi,

With v2 of this series, after doing (define glibc/hurd glibc), 
trying to build a hurd-vm

    ./pre-inst-env guix system build --target=i586-pc-gnu gnu/system/examples/bare-hurd.tmpl

now fails building

    /gnu/store/4hf24xkj93zjbq9ymbzaprxh0myk975c-hurd-minimal-cross-i586-pc-gnu-v0.9.git20230216.drv

--8<---------------cut here---------------start------------->8---
i586-pc-gnu-gcc -std=gnu99 -fgnu89-inline -Wall -g -O3 -fno-strict-aliasing  -g -O2 -I.  -I..  -I../include -I../include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -DPACKAGE_NAME=\"GNU\ Hurd\" -DPACKAGE_TARNAME=\"hurd\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"GNU\ Hurd\ 0.9\" -DPACKAGE_BUGREPORT=\"bug-hurd@gnu.org\" -DPACKAGE_URL=\"http://www.gnu.org/software/hurd/\" -DUTIME_NOW=-1 -DUTIME_OMIT=-2 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DX11_PREFIX=\"\" -DHAVE_STRUCT_THREAD_SCHED_INFO_LAST_PROCESSOR=1  -c -o wire.o wire.c
make[1]: *** No rule to make target 'mach/default_pager.h', needed by 'portinfo.o'.  Stop.
--8<---------------cut here---------------end--------------->8---

After upgrading hurd-headers to the latest tag, it fails building

    /gnu/store/5cw60kjg87zws8b39bnp7r7a8vgfhz2b-hurd-headers-cross-i586-pc-gnu-v0.9.git20230912.drv

in an even stranger way

--8<---------------cut here---------------start------------->8---
checking for libio... no
checking for file_exec_paths... (cached) no
checking for exec_exec_paths... (cached) no
checking for _hurd_exec_paths... (cached) no
checking for _hurd_libc_proc_init... (cached) no
checking for file_utimens... configure: error: link tests are not allowed after AC_NO_EXECUTABLES
--8<---------------cut here---------------end--------------->8---

...according to config.log the compiler it cannot find <stdio.h>.

This is just a heads-up, not sure if it has anything to do with this
series.  Possibly all hurd sources need to be updated nicely, dunno :)

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




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

* bug#67686: [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available
  2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
                     ` (6 preceding siblings ...)
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 7/7] gnu: glibc: Improve handling of empty .a files Ludovic Courtès
@ 2023-12-09 14:58   ` Ludovic Courtès
  2023-12-09 16:37     ` [bug#67686] " Efraim Flashner
  7 siblings, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-09 14:58 UTC (permalink / raw)
  To: 67686-done
  Cc: Josselin Poiret, Mathieu Othacehe, Tobias Geerinckx-Rice,
	Efraim Flashner, Ricardo Wurmus, Christopher Baines,
	Janneke Nieuwenhuizen

Hello!

I’ve just pushed v2:

  5bbddafeaa gnu: glibc: Improve handling of empty .a files.
  1cebc334a7 gnu: glibc: Ensure C.UTF-8 locale is always found.
  c76e44396e gnu: glibc: Install C.UTF-8 locale.
  d5242a562e gnu: glibc: Update to 2.38.
  cd43baad60 gnu: mpfr: Update to 4.2.1.
  3ea04038b5 gnu: glibc-utf8-locales: Generalize and use gexps.
  22f06be928 gnu: gcc@11: Update to 11.4.0.

I think it’s just the beginning of a journey :-) since we’ll have to
test and fix cross-compilation, and eventually investigate the
(define glibc/hurd glibc) problems Janneke already reported.

By pushing my hope is to get support from the build farms so we can test
these higher-level issues without having to rebuild everything locally.

Ludo’.




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

* [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
  2023-12-07 21:26     ` Ludovic Courtès
@ 2023-12-09 16:33       ` Efraim Flashner
  2023-12-09 21:41         ` Ludovic Courtès
  0 siblings, 1 reply; 28+ messages in thread
From: Efraim Flashner @ 2023-12-09 16:33 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 67686

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

On Thu, Dec 07, 2023 at 10:26:36PM +0100, Ludovic Courtès wrote:
> Ludovic Courtès <ludo@gnu.org> skribis:
> 
> > Ludovic Courtès <ludo@gnu.org> skribis:
> >
> >> +                     ;; Install the C.UTF-8 locale so there's always a UTF-8
> >> +                     ;; locale around.
> >> +                     (let* ((out (assoc-ref outputs "out"))
> >> +                            (bin (string-append out "/bin"))
> >> +                            (locale (string-append out "/lib/locale/"
> >> +                                                   ,(package-version
> >> +                                                     this-package))))
> >> +                       (mkdir-p locale)
> >> +                       (invoke (string-append bin "/localedef")
> >> +                               "--no-archive" "--prefix" locale
> >> +                               "-i" "C" "-f" "UTF-8"
> >> +                               (string-append locale "/C.UTF-8")))))
> >
> > I realize now that this cannot work when cross-compiling, because the
> > this ‘localedef’ binary is not executable on the build machine.
> >
> > I suspect libc builds an additional ‘localedef’ for the build machine
> > but I’m not sure where it is, hmm…
> 
> I was told on #glibc that (1) there’s no ‘localedef’ for the build
> machine produced during cross-compilation, and (2) that more generally,
> there’s no way to cross-build locale data, that endianness and other
> things may matter.
> 
> I suspect #2 was about the locale archive and not locale data, because
> evidence suggests that locale data is system-independent:
> 
> --8<---------------cut here---------------start------------->8---
> $ for s in aarch64-linux powerpc64le-linux armhf-linux i686-linux ; do diff -r $(guix build glibc-locales@2.35) $(guix build glibc-locales@2.35 -s "$s") && echo "$s same as x86_64-linux" ; done
> aarch64-linux same as x86_64-linux
> powerpc64le-linux same as x86_64-linux
> armhf-linux same as x86_64-linux
> i686-linux same as x86_64-linux
> $ guix describe
>   guix 6e2dd51
>     repository URL: https://git.savannah.gnu.org/git/guix.git
>     branch: master
>     commit: 6e2dd51df5f3f51e9056dd4f2e1b036195ab3caa
> --8<---------------cut here---------------end--------------->8---
> 
> Efraim, could you check against powerpc-linux, which is the only
> big-endian target we +/- support?

I found a difference in almost every file. The tarball of the locales
was too big to attach so I've uploaded it here¹.  Looking at it in
diffoscope it looked like most of the data that looked human readable
was the same, but there was some endian switching with the other data
bits.  So without actually checking other big endian systems it looks
like we could set target #f for the locales, but for those that share
their endianness.

¹ https://flashner.co.il/~efraim/glibc-locales-2.35-powerpc-linux.tar.xz

-- 
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] 28+ messages in thread

* [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available
  2023-12-09 14:58   ` bug#67686: [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
@ 2023-12-09 16:37     ` Efraim Flashner
  0 siblings, 0 replies; 28+ messages in thread
From: Efraim Flashner @ 2023-12-09 16:37 UTC (permalink / raw)
  To: Ludovic Courtès
  Cc: Josselin Poiret, Mathieu Othacehe, Tobias Geerinckx-Rice,
	Ricardo Wurmus, 67686-done, Christopher Baines,
	Janneke Nieuwenhuizen

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

On Sat, Dec 09, 2023 at 03:58:16PM +0100, Ludovic Courtès wrote:
> Hello!
> 
> I’ve just pushed v2:
> 
>   5bbddafeaa gnu: glibc: Improve handling of empty .a files.
>   1cebc334a7 gnu: glibc: Ensure C.UTF-8 locale is always found.
>   c76e44396e gnu: glibc: Install C.UTF-8 locale.
>   d5242a562e gnu: glibc: Update to 2.38.
>   cd43baad60 gnu: mpfr: Update to 4.2.1.
>   3ea04038b5 gnu: glibc-utf8-locales: Generalize and use gexps.
>   22f06be928 gnu: gcc@11: Update to 11.4.0.
> 
> I think it’s just the beginning of a journey :-) since we’ll have to
> test and fix cross-compilation, and eventually investigate the
> (define glibc/hurd glibc) problems Janneke already reported.
> 
> By pushing my hope is to get support from the build farms so we can test
> these higher-level issues without having to rebuild everything locally.

With the v1 patchset I found that by reverting the file update and
bringing it back to 5.44 I was able to build all the way to hello on
x86_64-linux, i686-linux, aarch64-linux, riscv64-linux and
powerpc64le-linux. I haven't tested armhf- or powerpc- yet.

For cross-compiling I ran into a test failure in mpfr@4.2.0 and 4.2.1
as needed by gcc-cross-i686-linux-gnu-11.4.0.

FAIL: tsprintf
==============

Error in mpfr_vsprintf (s, "%0+ -'13.10Pd:", ...);
expected: "+01,234,567  :"
got:      "+0001,234,567:"
FAIL tsprintf (exit status: 1)


-- 
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] 28+ messages in thread

* [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
  2023-12-09 16:33       ` Efraim Flashner
@ 2023-12-09 21:41         ` Ludovic Courtès
  2023-12-10  7:24           ` Efraim Flashner
  0 siblings, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-09 21:41 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 67686

Hello!

Efraim Flashner <efraim@flashner.co.il> skribis:

> On Thu, Dec 07, 2023 at 10:26:36PM +0100, Ludovic Courtès wrote:

[...]

>> I was told on #glibc that (1) there’s no ‘localedef’ for the build
>> machine produced during cross-compilation, and (2) that more generally,
>> there’s no way to cross-build locale data, that endianness and other
>> things may matter.
>> 
>> I suspect #2 was about the locale archive and not locale data, because
>> evidence suggests that locale data is system-independent:
>> 
>> --8<---------------cut here---------------start------------->8---
>> $ for s in aarch64-linux powerpc64le-linux armhf-linux i686-linux ; do diff -r $(guix build glibc-locales@2.35) $(guix build glibc-locales@2.35 -s "$s") && echo "$s same as x86_64-linux" ; done
>> aarch64-linux same as x86_64-linux
>> powerpc64le-linux same as x86_64-linux
>> armhf-linux same as x86_64-linux
>> i686-linux same as x86_64-linux
>> $ guix describe
>>   guix 6e2dd51
>>     repository URL: https://git.savannah.gnu.org/git/guix.git
>>     branch: master
>>     commit: 6e2dd51df5f3f51e9056dd4f2e1b036195ab3caa
>> --8<---------------cut here---------------end--------------->8---
>> 
>> Efraim, could you check against powerpc-linux, which is the only
>> big-endian target we +/- support?
>
> I found a difference in almost every file. The tarball of the locales
> was too big to attach so I've uploaded it here¹.  Looking at it in
> diffoscope it looked like most of the data that looked human readable
> was the same, but there was some endian switching with the other data
> bits.  So without actually checking other big endian systems it looks
> like we could set target #f for the locales, but for those that share
> their endianness.

OK, interesting, thanks for checking!

So we won’t be able to reliably provide C.UTF-8 in cross-compiled libcs.
Maybe not a big problem, but it does mean that cross-compiled code will
be “less capable” because of that.

Ludo’.




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

* [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38.
  2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38 Ludovic Courtès
@ 2023-12-09 21:44     ` Ludovic Courtès
  2023-12-10 10:14       ` Ludovic Courtès
  0 siblings, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-09 21:44 UTC (permalink / raw)
  To: 67686

Ludovic Courtès <ludo@gnu.org> skribis:

>   2. Check cross-compilation.

It’s looking surprisingly good!  With commit
5cf6c96ad9ffafccf180ec2d44c740b6999c02ac, I could do:

  guix build hello --target=aarch64-linux-gnu

… which resulted in a working AArch64 binary.

Ludo’.




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

* [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
  2023-12-09 21:41         ` Ludovic Courtès
@ 2023-12-10  7:24           ` Efraim Flashner
  0 siblings, 0 replies; 28+ messages in thread
From: Efraim Flashner @ 2023-12-10  7:24 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 67686

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

On Sat, Dec 09, 2023 at 10:41:41PM +0100, Ludovic Courtès wrote:
> Hello!
> 
> Efraim Flashner <efraim@flashner.co.il> skribis:
> 
> > On Thu, Dec 07, 2023 at 10:26:36PM +0100, Ludovic Courtès wrote:
> 
> [...]
> 
> >> I was told on #glibc that (1) there’s no ‘localedef’ for the build
> >> machine produced during cross-compilation, and (2) that more generally,
> >> there’s no way to cross-build locale data, that endianness and other
> >> things may matter.
> >> 
> >> I suspect #2 was about the locale archive and not locale data, because
> >> evidence suggests that locale data is system-independent:
> >> 
> >> --8<---------------cut here---------------start------------->8---
> >> $ for s in aarch64-linux powerpc64le-linux armhf-linux i686-linux ; do diff -r $(guix build glibc-locales@2.35) $(guix build glibc-locales@2.35 -s "$s") && echo "$s same as x86_64-linux" ; done
> >> aarch64-linux same as x86_64-linux
> >> powerpc64le-linux same as x86_64-linux
> >> armhf-linux same as x86_64-linux
> >> i686-linux same as x86_64-linux
> >> $ guix describe
> >>   guix 6e2dd51
> >>     repository URL: https://git.savannah.gnu.org/git/guix.git
> >>     branch: master
> >>     commit: 6e2dd51df5f3f51e9056dd4f2e1b036195ab3caa
> >> --8<---------------cut here---------------end--------------->8---
> >> 
> >> Efraim, could you check against powerpc-linux, which is the only
> >> big-endian target we +/- support?
> >
> > I found a difference in almost every file. The tarball of the locales
> > was too big to attach so I've uploaded it here¹.  Looking at it in
> > diffoscope it looked like most of the data that looked human readable
> > was the same, but there was some endian switching with the other data
> > bits.  So without actually checking other big endian systems it looks
> > like we could set target #f for the locales, but for those that share
> > their endianness.
> 
> OK, interesting, thanks for checking!
> 
> So we won’t be able to reliably provide C.UTF-8 in cross-compiled libcs.
> Maybe not a big problem, but it does mean that cross-compiled code will
> be “less capable” because of that.

We should be able to create some monstrosity of a #:target field to say
that within an endianness group target is #f but otherwise is
(%current-target-system). Should work for all the locale generators
actually.

untested:

(if (and (target-little-endian? (%current-system))
         (target-little-endian? (%current-target-system)))
    #f
    (%current-target-system))

Although if we are going to rely on target-little-endian we might want
to define that field in (guix platform) too so we don't assign an
endianness to 8-bit controllers or embedded systems.

-- 
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] 28+ messages in thread

* [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38.
  2023-12-09 21:44     ` Ludovic Courtès
@ 2023-12-10 10:14       ` Ludovic Courtès
  0 siblings, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2023-12-10 10:14 UTC (permalink / raw)
  To: 67686; +Cc: Janneke Nieuwenhuizen

Ludovic Courtès <ludo@gnu.org> skribis:

> Ludovic Courtès <ludo@gnu.org> skribis:
>
>>   2. Check cross-compilation.
>
> It’s looking surprisingly good!  With commit
> 5cf6c96ad9ffafccf180ec2d44c740b6999c02ac, I could do:
>
>   guix build hello --target=aarch64-linux-gnu
>
> … which resulted in a working AArch64 binary.

I spoke a bit too fast: the ‘qemu-binfmt’ service was running on the
machine so I didn’t spot a problem that commit
e4013b31266b40dc9cb250c44b2088d3931cb3b3 fixes.

Anyway, from that commit I could cross-build for aarch64-linux-gnu and
i586-gnu (still using glibc 2.37) and both work fine.

Ludo’.




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

end of thread, other threads:[~2023-12-10 10:15 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-07 10:19 [bug#67686] [PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
2023-12-07 20:11   ` Janneke Nieuwenhuizen
2023-12-07 21:13     ` Ludovic Courtès
2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 2/5] gnu: glibc-utf8-locales: Generalize and use gexps Ludovic Courtès
2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 3/5] DRAFT gnu: glibc: Update to 2.38 Ludovic Courtès
2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale Ludovic Courtès
2023-12-07 10:30   ` Ludovic Courtès
2023-12-07 20:31     ` Janneke Nieuwenhuizen
2023-12-07 21:12       ` Ludovic Courtès
2023-12-07 21:26     ` Ludovic Courtès
2023-12-09 16:33       ` Efraim Flashner
2023-12-09 21:41         ` Ludovic Courtès
2023-12-10  7:24           ` Efraim Flashner
2023-12-07 10:22 ` [bug#67686] [PATCH core-updates 5/5] gnu: glibc: Ensure C.UTF-8 locale is always found Ludovic Courtès
2023-12-07 22:54 ` [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 1/7] gnu: gcc@11: Update to 11.4.0 Ludovic Courtès
2023-12-08 17:39     ` Janneke Nieuwenhuizen
2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 2/7] gnu: glibc-utf8-locales: Generalize and use gexps Ludovic Courtès
2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 3/7] gnu: mpfr: Update to 4.2.1 Ludovic Courtès
2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38 Ludovic Courtès
2023-12-09 21:44     ` Ludovic Courtès
2023-12-10 10:14       ` Ludovic Courtès
2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 5/7] gnu: glibc: Install C.UTF-8 locale Ludovic Courtès
2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 6/7] gnu: glibc: Ensure C.UTF-8 locale is always found Ludovic Courtès
2023-12-07 22:54   ` [bug#67686] [PATCH core-updates v2 7/7] gnu: glibc: Improve handling of empty .a files Ludovic Courtès
2023-12-09 14:58   ` bug#67686: [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available Ludovic Courtès
2023-12-09 16:37     ` [bug#67686] " Efraim Flashner

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