GNU bug report logs - #67686
[PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Thu, 7 Dec 2023 10:21:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67686 in the body.
You can then email your comments to 67686 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 10:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 07 Dec 2023 10:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates 0/5] Update glibc to 2.38;
 make C.UTF-8 always available
Date: Thu,  7 Dec 2023 11:19:52 +0100
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 <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 10:24:02 GMT) Full text and rfc822 format available.

Message #8 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Greg Hogan <code <at> greghogan.com>
Subject: [PATCH core-updates 1/5] gnu: gcc <at> 11: Update to 11.4.0.
Date: Thu,  7 Dec 2023 11:22:44 +0100
From: Greg Hogan <code <at> 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 <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 10:24:02 GMT) Full text and rfc822 format available.

Message #11 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates 2/5] gnu: glibc-utf8-locales: Generalize and use
 gexps.
Date: Thu,  7 Dec 2023 11:22:45 +0100
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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 10:24:02 GMT) Full text and rfc822 format available.

Message #14 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates 3/5] DRAFT gnu: glibc: Update to 2.38.
Date: Thu,  7 Dec 2023 11:22:46 +0100
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 <at> jpoiret.xyz>
-From: Josselin Poiret <dev <at> jpoiret.xyz>
-Date: Sat, 13 May 2023 14:10:43 +0200
-Subject: [PATCH] Add versioned locpath
-
-From: Josselin Poiret <dev <at> 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
  
  /* 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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 10:24:03 GMT) Full text and rfc822 format available.

Message #17 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
Date: Thu,  7 Dec 2023 11:22:47 +0100
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 10:24:03 GMT) Full text and rfc822 format available.

Message #20 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates 5/5] gnu: glibc: Ensure C.UTF-8 locale is always
 found.
Date: Thu,  7 Dec 2023 11:22:48 +0100
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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 10:32:02 GMT) Full text and rfc822 format available.

Message #23 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Subject: Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install
 C.UTF-8 locale.
Date: Thu, 07 Dec 2023 11:30:10 +0100
Ludovic Courtès <ludo <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 20:13:01 GMT) Full text and rfc822 format available.

Message #26 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 67686 <at> debbugs.gnu.org, Greg Hogan <code <at> greghogan.com>
Subject: Re: [bug#67686] [PATCH core-updates 1/5] gnu: gcc <at> 11: Update to
 11.4.0.
Date: Thu, 07 Dec 2023 21:11:54 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès writes:

> From: Greg Hogan <code <at> 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.

[0001-squash-gnu-gcc-11-Update-to-11.4.0.patch (text/x-patch, inline)]
From aa0896545b283adc2c7451bbccca2b391a5affb8 Mon Sep 17 00:00:00 2001
Message-ID: <aa0896545b283adc2c7451bbccca2b391a5affb8.1701979835.git.janneke <at> gnu.org>
From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
Date: Thu, 7 Dec 2023 21:04:31 +0100
Subject: [PATCH] squash! gnu: gcc <at> 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

[Message part 3 (text/plain, inline)]
-- 
Janneke Nieuwenhuizen <janneke <at> gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 20:32:01 GMT) Full text and rfc822 format available.

Message #29 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 67686 <at> debbugs.gnu.org
Subject: Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install
 C.UTF-8 locale.
Date: Thu, 07 Dec 2023 21:31:14 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès writes:

Hello!

> Ludovic Courtès <ludo <at> 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

[0001-gnu-mpfr-Update-to-4.2.1.patch (text/x-patch, inline)]
From e8b5a6c064b0395ca84749987c97dd9e1172b9ab Mon Sep 17 00:00:00 2001
Message-ID: <e8b5a6c064b0395ca84749987c97dd9e1172b9ab.1701980952.git.janneke <at> gnu.org>
From: Janneke Nieuwenhuizen <janneke <at> 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

[Message part 3 (text/plain, inline)]
-- 
Janneke Nieuwenhuizen <janneke <at> gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 21:13:02 GMT) Full text and rfc822 format available.

Message #32 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Janneke Nieuwenhuizen <janneke <at> gnu.org>
Cc: 67686 <at> debbugs.gnu.org
Subject: Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install
 C.UTF-8 locale.
Date: Thu, 07 Dec 2023 22:12:06 +0100
Hi!

Janneke Nieuwenhuizen <janneke <at> gnu.org> skribis:

>>From e8b5a6c064b0395ca84749987c97dd9e1172b9ab Mon Sep 17 00:00:00 2001
> Message-ID: <e8b5a6c064b0395ca84749987c97dd9e1172b9ab.1701980952.git.janneke <at> gnu.org>
> From: Janneke Nieuwenhuizen <janneke <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 21:14:01 GMT) Full text and rfc822 format available.

Message #35 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Janneke Nieuwenhuizen <janneke <at> gnu.org>
Cc: 67686 <at> debbugs.gnu.org, Greg Hogan <code <at> greghogan.com>
Subject: Re: [bug#67686] [PATCH core-updates 1/5] gnu: gcc <at> 11: Update to
 11.4.0.
Date: Thu, 07 Dec 2023 22:13:20 +0100
Janneke Nieuwenhuizen <janneke <at> gnu.org> skribis:

>>From aa0896545b283adc2c7451bbccca2b391a5affb8 Mon Sep 17 00:00:00 2001
> Message-ID: <aa0896545b283adc2c7451bbccca2b391a5affb8.1701979835.git.janneke <at> gnu.org>
> From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
> Date: Thu, 7 Dec 2023 21:04:31 +0100
> Subject: [PATCH] squash! gnu: gcc <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 21:28:01 GMT) Full text and rfc822 format available.

Message #38 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install
 C.UTF-8 locale.
Date: Thu, 07 Dec 2023 22:26:36 +0100
Ludovic Courtès <ludo <at> gnu.org> skribis:

> Ludovic Courtès <ludo <at> 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 <at> 2.35) $(guix build glibc-locales <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 22:11:02 GMT) Full text and rfc822 format available.

Message #41 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 67044 <at> debbugs.gnu.org, 67686 <at> debbugs.gnu.org
Subject: Re: bug#67044: C.utf8 locale cannot be built
Date: Thu, 7 Dec 2023 23:09:40 +0100
[Message part 1 (text/plain, inline)]
Hi :)

On 2023-12-07 11:27:04 +0100, Ludovic Courtès wrote:
> [..]
>
> I decided to give it a go:
>
>   https://issues.guix.gnu.org/67686
>
> Please do chime in and let me know what you think!

Thanks to the detailed cover letter, now I understand the benefit, so I agree it
would make sense.  I looked over the implementation, and it looks fine to me (I
am not sure if I am qualified to do the review though :) ).

I just have few notes:

1.

> (glibc-2.35)[arguments]: Delete ‘install-utf8-c-locale’ phase.

I do think 2.35 should install the locale as well.  That would require to change

    (invoke (string-append bin "/localedef")
            "--no-archive" "--prefix" locale
            "-i" "C" "-f" "UTF-8"
            (string-append locale "/C.UTF-8")))))

into

    (invoke (string-append bin "/localedef")
            "-c" "--no-archive" "--prefix" locale
            "-i" "C" "-f" "UTF-8"
            (string-append locale "/C.UTF-8")))))

however I think that is fine.  I am using locale built like that and it works
well.  What is more, from the discussion under the other issue[0], that is
exactly what is done during normal glibc build:

> It turns out we ignore errors during the glibc build (--quiet -c).

After that the drop of 'install-utf8-c-locale can be moved into some other
version < 2.35.

2.

I still believe it makes sense to add the -c also into the locale builder,
because my understanding is that this change will not allow using (locale
"C.utf8") in the operating-system definition (since that would still try to
build it, and fail).

If you are not opposed to the idea, I can send a patch if you would prefer not
to do it yourself.

3.

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

I looked around a bit, and I am not sure that is true.  There seems to be only
./locale/localedef created.  However, there is localedef inside gcc-toolchain's
bin directory, and, of course, in the build glibc.  I am not sure what are the
version requirements here, but I would expect at least the one provided by glibc
to be usable.



Have a nice day,
Tomas

0: https://sourceware.org/bugzilla/show_bug.cgi?id=28845

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 22:56:02 GMT) Full text and rfc822 format available.

Message #44 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates v2 2/7] gnu: glibc-utf8-locales: Generalize and
 use gexps.
Date: Thu,  7 Dec 2023 23:54:05 +0100
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





Information forwarded to guix <at> cbaines.net, dev <at> jpoiret.xyz, othacehe <at> gnu.org, rekado <at> elephly.net, me <at> tobias.gr, efraim <at> flashner.co.il, ludo <at> gnu.org, janneke <at> gnu.org, guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 22:56:02 GMT) Full text and rfc822 format available.

Message #47 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates v2 0/7] Update glibc to 2.38;
 make C.UTF-8 always available
Date: Thu,  7 Dec 2023 23:54:03 +0100
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 <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 22:56:02 GMT) Full text and rfc822 format available.

Message #50 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Greg Hogan <code <at> greghogan.com>, Janneke Nieuwenhuizen <janneke <at> gnu.org>
Subject: [PATCH core-updates v2 1/7] gnu: gcc <at> 11: Update to 11.4.0.
Date: Thu,  7 Dec 2023 23:54:04 +0100
From: Greg Hogan <code <at> 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 <at> gnu.org>
Signed-off-by: Ludovic Courtès <ludo <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 22:56:03 GMT) Full text and rfc822 format available.

Message #53 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Janneke Nieuwenhuizen <janneke <at> gnu.org>
Subject: [PATCH core-updates v2 3/7] gnu: mpfr: Update to 4.2.1.
Date: Thu,  7 Dec 2023 23:54:06 +0100
From: Janneke Nieuwenhuizen <janneke <at> 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 <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 22:56:03 GMT) Full text and rfc822 format available.

Message #56 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38.
Date: Thu,  7 Dec 2023 23:54:07 +0100
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 <at> jpoiret.xyz>
-From: Josselin Poiret <dev <at> jpoiret.xyz>
-Date: Sat, 13 May 2023 14:10:43 +0200
-Subject: [PATCH] Add versioned locpath
-
-From: Josselin Poiret <dev <at> 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
  
  /* 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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 22:56:04 GMT) Full text and rfc822 format available.

Message #59 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates v2 5/7] gnu: glibc: Install C.UTF-8 locale.
Date: Thu,  7 Dec 2023 23:54:08 +0100
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 22:56:04 GMT) Full text and rfc822 format available.

Message #62 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates v2 6/7] gnu: glibc: Ensure C.UTF-8 locale is
 always found.
Date: Thu,  7 Dec 2023 23:54:09 +0100
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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Thu, 07 Dec 2023 22:56:05 GMT) Full text and rfc822 format available.

Message #65 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates v2 7/7] gnu: glibc: Improve handling of empty .a
 files.
Date: Thu,  7 Dec 2023 23:54:10 +0100
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





Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Fri, 08 Dec 2023 17:41:01 GMT) Full text and rfc822 format available.

Message #68 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 67686 <at> debbugs.gnu.org, Josselin Poiret <dev <at> jpoiret.xyz>
Subject: Re: [PATCH core-updates v2 1/7] gnu: gcc <at> 11: Update to 11.4.0.
Date: Fri, 08 Dec 2023 18:39:35 +0100
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 <at> 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 <at> gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Sat, 09 Dec 2023 14:48:02 GMT) Full text and rfc822 format available.

Message #71 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: 67044 <at> debbugs.gnu.org, 67686 <at> debbugs.gnu.org
Subject: Re: [bug#67686] bug#67044: C.utf8 locale cannot be built
Date: Sat, 09 Dec 2023 15:46:58 +0100
Hi Tomas,

Tomas Volf <~@wolfsden.cz> skribis:

>> (glibc-2.35)[arguments]: Delete ‘install-utf8-c-locale’ phase.
>
> I do think 2.35 should install the locale as well.  That would require to change
>
>     (invoke (string-append bin "/localedef")
>             "--no-archive" "--prefix" locale
>             "-i" "C" "-f" "UTF-8"
>             (string-append locale "/C.UTF-8")))))
>
> into
>
>     (invoke (string-append bin "/localedef")
>             "-c" "--no-archive" "--prefix" locale
>             "-i" "C" "-f" "UTF-8"
>             (string-append locale "/C.UTF-8")))))
>
> however I think that is fine.  I am using locale built like that and it works
> well.  What is more, from the discussion under the other issue[0], that is
> exactly what is done during normal glibc build:
>
>> It turns out we ignore errors during the glibc build (--quiet -c).
>
> After that the drop of 'install-utf8-c-locale can be moved into some other
> version < 2.35.

I’m a bit wary of using ‘-c’ (aka. ‘--force’) unconditionally as this
could hide real problems.

But more importantly, I think it won’t matter whether glibc 2.35 ships
C.UTF-8 since it’s no longer going to be used, except for building old
locale data via ‘locale-libcs’.

> 2.
>
> I still believe it makes sense to add the -c also into the locale builder,
> because my understanding is that this change will not allow using (locale
> "C.utf8") in the operating-system definition (since that would still try to
> build it, and fail).
>
> If you are not opposed to the idea, I can send a patch if you would prefer not
> to do it yourself.

No you’re right, we could add ‘-c’ to the code in (gnu system locale),
though perhaps it would be safer to do so only in the 2.35 + C.UTF-8
case.

(We can do that independently of this patch.)

> 3.
>
>> I suspect libc builds an additional ‘localedef’ for the build machine but I’m
>> not sure where it is, hmm…
>
> I looked around a bit, and I am not sure that is true.

In the meantime I found that this is wrong indeed:

  https://issues.guix.gnu.org/67686#11

Thanks for your feedback!

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sat, 09 Dec 2023 14:59:01 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Sat, 09 Dec 2023 14:59:01 GMT) Full text and rfc822 format available.

Message #76 received at 67686-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686-done <at> debbugs.gnu.org
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Efraim Flashner <efraim <at> flashner.co.il>,
 Ricardo Wurmus <rekado <at> elephly.net>, Christopher Baines <guix <at> cbaines.net>,
 Janneke Nieuwenhuizen <janneke <at> gnu.org>
Subject: Re: [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38;
 make C.UTF-8 always available
Date: Sat, 09 Dec 2023 15:58:16 +0100
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 <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Sat, 09 Dec 2023 16:34:02 GMT) Full text and rfc822 format available.

Message #79 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 67686 <at> debbugs.gnu.org
Subject: Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8
 locale.
Date: Sat, 9 Dec 2023 18:33:19 +0200
[Message part 1 (text/plain, inline)]
On Thu, Dec 07, 2023 at 10:26:36PM +0100, Ludovic Courtès wrote:
> Ludovic Courtès <ludo <at> gnu.org> skribis:
> 
> > Ludovic Courtès <ludo <at> 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 <at> 2.35) $(guix build glibc-locales <at> 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 <at> 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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Sat, 09 Dec 2023 16:38:01 GMT) Full text and rfc822 format available.

Message #82 received at 67686-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Ricardo Wurmus <rekado <at> elephly.net>,
 67686-done <at> debbugs.gnu.org, Christopher Baines <guix <at> cbaines.net>,
 Janneke Nieuwenhuizen <janneke <at> gnu.org>
Subject: Re: [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38;
 make C.UTF-8 always available
Date: Sat, 9 Dec 2023 18:37:15 +0200
[Message part 1 (text/plain, inline)]
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 <at> 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 <at> 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 <at> 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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Sat, 09 Dec 2023 21:43:02 GMT) Full text and rfc822 format available.

Message #85 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 67686 <at> debbugs.gnu.org
Subject: Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install
 C.UTF-8 locale.
Date: Sat, 09 Dec 2023 22:41:41 +0100
Hello!

Efraim Flashner <efraim <at> 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 <at> 2.35) $(guix build glibc-locales <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Sat, 09 Dec 2023 21:46:02 GMT) Full text and rfc822 format available.

Message #88 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Subject: Re: [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc:
 Update to 2.38.
Date: Sat, 09 Dec 2023 22:44:38 +0100
Ludovic Courtès <ludo <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Sun, 10 Dec 2023 00:58:02 GMT) Full text and rfc822 format available.

Message #91 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 67044 <at> debbugs.gnu.org, 67686 <at> debbugs.gnu.org
Subject: Re: [bug#67686] bug#67044: C.utf8 locale cannot be built
Date: Sun, 10 Dec 2023 01:57:22 +0100
[Message part 1 (text/plain, inline)]
On 2023-12-09 15:46:58 +0100, Ludovic Courtès wrote:
> > I still believe it makes sense to add the -c also into the locale builder,
> > because my understanding is that this change will not allow using (locale
> > "C.utf8") in the operating-system definition (since that would still try to
> > build it, and fail).
> >
> > If you are not opposed to the idea, I can send a patch if you would prefer not
> > to do it yourself.
>
> No you’re right, we could add ‘-c’ to the code in (gnu system locale),
> though perhaps it would be safer to do so only in the 2.35 + C.UTF-8
> case.
>
> (We can do that independently of this patch.)

My attempt at that can be found here: https://issues.guix.gnu.org/67735

Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Sun, 10 Dec 2023 07:25:03 GMT) Full text and rfc822 format available.

Message #94 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 67686 <at> debbugs.gnu.org
Subject: Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8
 locale.
Date: Sun, 10 Dec 2023 09:24:01 +0200
[Message part 1 (text/plain, inline)]
On Sat, Dec 09, 2023 at 10:41:41PM +0100, Ludovic Courtès wrote:
> Hello!
> 
> Efraim Flashner <efraim <at> 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 <at> 2.35) $(guix build glibc-locales <at> 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 <at> 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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#67686; Package guix-patches. (Sun, 10 Dec 2023 10:15:02 GMT) Full text and rfc822 format available.

Message #97 received at 67686 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 67686 <at> debbugs.gnu.org
Cc: Janneke Nieuwenhuizen <janneke <at> gnu.org>
Subject: Re: [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc:
 Update to 2.38.
Date: Sun, 10 Dec 2023 11:14:11 +0100
Ludovic Courtès <ludo <at> gnu.org> skribis:

> Ludovic Courtès <ludo <at> 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’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Jan 2024 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 129 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.