[PATCH core-updates 0/5] Update glibc to 2.38; make C.UTF-8 always available

  • Done
  • quality assurance status badge
Details
4 participants
  • Efraim Flashner
  • Janneke Nieuwenhuizen
  • Ludovic Courtès
  • Tomas Volf
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal
L
L
Ludovic Courtès wrote on 7 Dec 2023 11:19
(address . guix-patches@gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
cover.1701943221.git.ludo@gnu.org
Hello fellow core updaters!

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

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

With the upgrade, we should be able to:

(define-public glibc/hurd glibc)

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

As for #2, it means that:

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

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

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

with:

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

Thoughts?

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

Ludo’.

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

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

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


base-commit: 69d31a158001f2cb97983bd13f4575f6c9484451
--
2.41.0
L
L
Ludovic Courtès wrote on 7 Dec 2023 11:22
[PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0.
(address . 67686@debbugs.gnu.org)
84287ec2c97471228f0b4e1db1ae14b155bbde88.1701943221.git.ludo@gnu.org
From: Greg Hogan <code@greghogan.com>

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

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

Toggle diff (78 lines)
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
L
L
Ludovic Courtès wrote on 7 Dec 2023 11:22
[PATCH core-updates 2/5] gnu: glibc-utf8-locales: Generalize and use gexps.
(address . 67686@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
614bd1b35c61d23a3de82c292cf3f55d52b56b29.1701943221.git.ludo@gnu.org
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(-)

Toggle diff (90 lines)
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
L
L
Ludovic Courtès wrote on 7 Dec 2023 11:22
[PATCH core-updates 3/5] DRAFT gnu: glibc: Update to 2.38.
(address . 67686@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
591e6131c16d1d54dfa23291b35bffca81551956.1701943221.git.ludo@gnu.org
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

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

Toggle diff (68 lines)
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
L
L
Ludovic Courtès wrote on 7 Dec 2023 11:22
[PATCH core-updates 5/5] gnu: glibc: Ensure C.UTF-8 locale is always found.
(address . 67686@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
26b8d546eb51e3ef25c160a1e18b4ecb45206540.1701943221.git.ludo@gnu.org
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(-)

Toggle diff (49 lines)
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
L
L
Ludovic Courtès wrote on 7 Dec 2023 11:30
Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
(address . 67686@debbugs.gnu.org)
87v89ae24t.fsf@gnu.org
Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (13 lines)
> + ;; 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’.
J
J
Janneke Nieuwenhuizen wrote on 7 Dec 2023 21:11
Re: [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0.
(name . Ludovic Courtès)(address . ludo@gnu.org)
8734wd93hx.fsf@gnu.org
Ludovic Courtès writes:

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

[On core-updates] this patch is still used, I recommend the attatched
squash commit.
From aa0896545b283adc2c7451bbccca2b391a5affb8 Mon Sep 17 00:00:00 2001
Message-ID: <aa0896545b283adc2c7451bbccca2b391a5affb8.1701979835.git.janneke@gnu.org>
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Thu, 7 Dec 2023 21:04:31 +0100
Subject: [PATCH] squash! gnu: gcc@11: Update to 11.4.0.

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

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

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

Toggle diff (55 lines)
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
--
Janneke Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com| Avatar® https://AvatarAcademy.com
J
J
Janneke Nieuwenhuizen wrote on 7 Dec 2023 21:31
Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 67686@debbugs.gnu.org)
87wmtp7o19.fsf@gnu.org
Ludovic Courtès writes:

Hello!

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

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

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

Toggle snippet (23 lines)
======================================
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)

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

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

This fixes building mpfr with glibc-2.38.

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

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

Toggle diff (24 lines)
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
--
Janneke Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com| Avatar® https://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 7 Dec 2023 22:12
(name . Janneke Nieuwenhuizen)(address . janneke@gnu.org)(address . 67686@debbugs.gnu.org)
87v899d8ex.fsf@gnu.org
Hi!

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

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

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

Thanks!

Ludo’.
L
L
Ludovic Courtès wrote on 7 Dec 2023 22:13
Re: [bug#67686] [PATCH core-updates 1/5] gnu: gcc@11: Update to 11.4.0.
(name . Janneke Nieuwenhuizen)(address . janneke@gnu.org)
87r0jxd8cv.fsf@gnu.org
Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

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

Good catch, added!

Ludo’.
L
L
Ludovic Courtès wrote on 7 Dec 2023 22:26
Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
(address . 67686@debbugs.gnu.org)(name . Efraim Flashner)(address . efraim@flashner.co.il)
87fs0dd7qr.fsf@gnu.org
Ludovic Courtès <ludo@gnu.org> skribis:

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

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

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

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

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

Ludo’.
T
T
Tomas Volf wrote on 7 Dec 2023 23:09
Re: bug#67044: C.utf8 locale cannot be built
(name . Ludovic Courtès)(address . ludo@gnu.org)
ZXJCpL0u0UoEb8YA@ws
Hi :)

On 2023-12-07 11:27:04 +0100, Ludovic Courtès wrote:
Toggle quote (8 lines)
> [..]
>
> 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.

Toggle quote (2 lines)
> (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:

Toggle quote (2 lines)
> 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.

Toggle quote (3 lines)
> 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


--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmVyQqQACgkQL7/ufbZ/
wan7vA//RKpYBFeFpE6FNHWrCZwPhxNy/d/lna/1TCPdf1smFe1cwvkwGthh0DJF
l8sqd9U5faEUeY58vpzZRHZ0kUJHfMKbzEzzCrB1OV8uw6fkY8RYVy9rRdSS8vrZ
R3SKbFcYo8zHBcVGE2pve1MAY48TyqJY+EHOfz7XAb3osOMJt8E/JjSSmhBB8k8c
9cY0wUbACuTmViFagniR27/y3n3TAr3BHRDWRCXLtQx24/JjcQw8uWKFljemTwSk
BHiNyzXxv1ajr63Bfy5txFSRmn2MkubOmohFjkTwD9ApG/J7VMPiRLS22mPgSv98
1qB9/BzQ/s/4ktP+V2+jqrvZRe33b8b6brHpwd9P7eNKvjcERiG6kyu0d3Otmbnc
MsoCChne0Ao9gdKfkwJZq16aktpDCuyHXAP8jdvy1xLjREMInM2lmV+yR7EJJ7vE
Srt05ckoFoPAvPSUEyCJNPC5i07nmEn9oODSXuZHpDWd1I1n1m27jgRzIT69j8Ua
l3Hfi4xruGX+FsMaltrqPKnjRNyfseOp0CXhddZv8Lo8XPKh7wrdHG/7o8PF3pN1
KLbZFEXU9F8bAkK0DV3UNdDIKAH7R131ZsyjvPhG0UFknEXCbUJy1wLxiqlwYaJd
yD++ZP+ZN4s+jtqmjUlbP1cEZFyffmYc1R3JQ8+mIHa2FcD515Q=
=o7Za
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 7 Dec 2023 23:54
[PATCH core-updates v2 2/7] gnu: glibc-utf8-locales: Generalize and use gexps.
(address . 67686@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
3ea04038b5842fc20281fa70288d3f94753d2174.1701989279.git.ludo@gnu.org
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(-)

Toggle diff (90 lines)
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
L
L
Ludovic Courtès wrote on 7 Dec 2023 23:54
[PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available
(address . 67686@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
cover.1701989279.git.ludo@gnu.org
Changes since v1:

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

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

• Incorporated the GCC and MPFR patches by Janneke.

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

Ludo’.

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

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

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

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


base-commit: 69d31a158001f2cb97983bd13f4575f6c9484451
--
2.41.0
L
L
Ludovic Courtès wrote on 7 Dec 2023 23:54
[PATCH core-updates v2 1/7] gnu: gcc@11: Update to 11.4.0.
(address . 67686@debbugs.gnu.org)
22f06be9287e22272bf3f34b91e9711e29bea129.1701989279.git.ludo@gnu.org
From: Greg Hogan <code@greghogan.com>

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

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

Toggle diff (27 lines)
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
L
L
Ludovic Courtès wrote on 7 Dec 2023 23:54
[PATCH core-updates v2 3/7] gnu: mpfr: Update to 4.2.1.
(address . 67686@debbugs.gnu.org)
cd43baad60ab1a2ae2b35fb318b8a8c2916984ae.1701989279.git.ludo@gnu.org
From: Janneke Nieuwenhuizen <janneke@gnu.org>

This fixes building mpfr with glibc-2.38.

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

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

Toggle diff (22 lines)
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
L
L
Ludovic Courtès wrote on 7 Dec 2023 23:54
[PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38.
(address . 67686@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
739f88b862b034289764f75e77fa6b438116d767.1701989279.git.ludo@gnu.org
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

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

Toggle diff (73 lines)
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
L
L
Ludovic Courtès wrote on 7 Dec 2023 23:54
[PATCH core-updates v2 6/7] gnu: glibc: Ensure C.UTF-8 locale is always found.
(address . 67686@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
45f8dc327b923102ce8b915bb07a3f3dc016f6b2.1701989279.git.ludo@gnu.org
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(-)

Toggle diff (49 lines)
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
L
L
Ludovic Courtès wrote on 7 Dec 2023 23:54
[PATCH core-updates v2 7/7] gnu: glibc: Improve handling of empty .a files.
(address . 67686@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
937aa63bbbbe688c12b9622150140f7739a63618.1701989279.git.ludo@gnu.org
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(-)

Toggle diff (53 lines)
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
J
J
Janneke Nieuwenhuizen wrote on 8 Dec 2023 18:39
Re: [PATCH core-updates v2 1/7] gnu: gcc@11: Update to 11.4.0.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87wmtoy4o8.fsf@gnu.org
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

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

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

Toggle snippet (8 lines)
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

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

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

Greetings,
Janneke

--
Janneke Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com| Avatar® https://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 9 Dec 2023 15:46
Re: [bug#67686] bug#67044: C.utf8 locale cannot be built
(name . Tomas Volf)(address . ~@wolfsden.cz)
87a5qj5t7h.fsf@gnu.org
Hi Tomas,

Tomas Volf <~@wolfsden.cz> skribis:

Toggle quote (25 lines)
>> (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’.

Toggle quote (10 lines)
> 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.)

Toggle quote (7 lines)
> 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:


Thanks for your feedback!

Ludo’.
L
L
Ludovic Courtès wrote on 9 Dec 2023 15:58
Re: [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available
(address . 67686-done@debbugs.gnu.org)
875y175son.fsf@gnu.org
Hello!

I’ve just pushed v2:

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

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

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

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

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


--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmV0ls0ACgkQQarn3Mo9
g1EgRw//ZeHYQ3kRKnihrjcE4UkEfg9XFqUgqIanQfkFCa7LXaGUJsWvpbdoZoOi
EkyGyMo3wNstD7BTF44jjK0Ai02crHwSAev3ubOlCDAEHGSoJLMPhVsLhmISFcBY
64cRSFy0yXNREdS/4gJs0/+M5KE5My37psPumDILaBN11gwxPw37RhBFTjUXjY60
KMH0PkNI8CyFoEkVEtbUGeoC6qgLkH9OnzrjqwyT6pvIP1a5Y4LhJxQbXrEbIbbA
kKYNdb3SygTKrirLaVay2XL+UQwx8KYnoxBy2O3/kQG+fMSHb8wvmaFLFUhtMOtP
dUhmcz2AJD4ctbadYEz1qrVGDhfaTliQpThxccc0v+6LytrViza+qMhoD/mi+/sS
pWmvhin/3jniOxXatnTPNvWL0RkFtmHXvVJxBs4IUqRlcuSpG1cMCcWSETp8iDSh
eShNOaQ1Fj4uonrcSzUlOdbt51RE29FudKkehzWPFv/CD1sQopUJLHUynAyQW9Mc
+wTH796PUEiXK9OT1BH9AmkPubW+2fM/FRd5afFjJ/b7JpNKow6rvZv132UYIw1R
umIDml4sMg2EphNmcSNGFzbHTZJIYD0SGYT9TV/40s3yXkzU9VyBWoWlWUT1EPok
K1I57QASGLaiqAD9nq7NsYV7X4XFd/QqghT4z5jkUsQ/nci3Ih0=
=EKuL
-----END PGP SIGNATURE-----


E
E
Efraim Flashner wrote on 9 Dec 2023 17:37
Re: [bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available
(name . Ludovic Courtès)(address . ludo@gnu.org)
ZXSXuwpIkjK6fSVt@3900XT
On Sat, Dec 09, 2023 at 03:58:16PM +0100, Ludovic Courtès wrote:
Toggle quote (19 lines)
> Hello!
>
> I’ve just pushed v2:
>
> 5bbddafeaa gnu: glibc: Improve handling of empty .a files.
> 1cebc334a7 gnu: glibc: Ensure C.UTF-8 locale is always found.
> c76e44396e gnu: glibc: Install C.UTF-8 locale.
> d5242a562e gnu: glibc: Update to 2.38.
> cd43baad60 gnu: mpfr: Update to 4.2.1.
> 3ea04038b5 gnu: glibc-utf8-locales: Generalize and use gexps.
> 22f06be928 gnu: gcc@11: Update to 11.4.0.
>
> I think it’s just the beginning of a journey :-) since we’ll have to
> test and fix cross-compilation, and eventually investigate the
> (define glibc/hurd glibc) problems Janneke already reported.
>
> By pushing my hope is to get support from the build farms so we can test
> these higher-level issues without having to rebuild everything locally.

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

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

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

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


--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmV0l7sACgkQQarn3Mo9
g1HsoA/+JRfXZKzdiXKQqrcWpiGA/hXi0cx1bd6cFMfNQutDT4oRvVqiTnwmGEtA
h0DYNvwjG3i9s6XRLFC4GQBfGbPBRuBNqSyE8gWLB0QriAE3YN7IEDS2WduS35A7
/aJhw/XHYo76Dsk2obVfQo82Ssnm7sJjlgUD8T4bn88gCVzVEVqVx4KTDHLAApLe
LPJ8wKhVxx2/k2MdCKsPaL90qxKdf9KoxiMv6bO2711gbmY5FdDN1ppT1G4c0KS4
JJ4gRLCXK0qjyGu4Z/VRZvATNjs7Xoz/n5cI87Q/he4v6HOhqQgkkq7VQvpIHxHB
X9FfwqJOukOJ+/yKzszQzp/JhoHoum26GMW88SK/1HZIIP7v2q0lBzBMEDTCT1qk
katsJn8p08FGfvaZCmjKBdOyOb6qFeRt5cCuC0KqW55YPsqG7/PAEDLcqJYN82/Y
FYS7O1s0Y+55e3IiuiAZjRDz0TM6LdIscSm2TYYZE6zHm9QsCvzOAGTO5yWeBh8+
dLJRdnYtOmKUr8hPR2RrAaApxUnhYbj9NLxaqKseWLzGV498pXx0ffkuSs4AbY04
lgEmzbMJ3XL0gePSTMp7D8sml8blZe0aENSSJd3XDkda0r5XW24kuItbCRFalpUN
3Ud4QmxUpRYLNo8T4EmpKH8vRRY2M5SbHaja0zYAEknrAtj6i5Y=
=hAW6
-----END PGP SIGNATURE-----


Closed
L
L
Ludovic Courtès wrote on 9 Dec 2023 22:41
Re: [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale.
(name . Efraim Flashner)(address . efraim@flashner.co.il)(address . 67686@debbugs.gnu.org)
87v8973vfu.fsf@gnu.org
Hello!

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

Toggle quote (2 lines)
> On Thu, Dec 07, 2023 at 10:26:36PM +0100, Ludovic Courtès wrote:

[...]

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

OK, interesting, thanks for checking!

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

Ludo’.
L
L
Ludovic Courtès wrote on 9 Dec 2023 22:44
Re: [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38.
(address . 67686@debbugs.gnu.org)
87plzf3vax.fsf@gnu.org
Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (2 lines)
> 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’.
T
T
Tomas Volf wrote on 10 Dec 2023 01:57
Re: [bug#67686] bug#67044: C.utf8 locale cannot be built
(name . Ludovic Courtès)(address . ludo@gnu.org)
ZXUM8kHTfiKswOh7@ws
On 2023-12-09 15:46:58 +0100, Ludovic Courtès wrote:
Toggle quote (14 lines)
> > 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.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmV1DPIACgkQL7/ufbZ/
wakzhw//cJZHhz2Np/v2qjk6+hNBO5aAeCcA1NcVmfO/CPoLsIu2I/uOkYJi3ClS
b5cJLwhpQ3PV2Dyffi2eteBrs0clBeTy04Q8BPAY1H69bG2pWPAHvgT6roA0gBdl
I37CKs6Mg9LYgxgiYpOqfkV4qoPP6GxZyjs5jXlA4Uw/esWS33oL1NRacsZ+Ffin
Gx3uh9uZdAlZLc2G4vAIPGyoTw9rijILC9h59cJ71xASKvj9XYD2aUm6gkFI900v
w9TMA/kYO3PR86mheX4Vkvs8kmqSyR6PiGzDjkN1lH3tG5n21TaEiuR873y2te7d
ZHU5r7XmT/XuqZ818jhA1xQYt5D7PkRVeGPanjmlK1Dc4j77+jeYUDWBaW+tWKC8
zzmGCNztop0fEHr2jAmi4Vu/dk72fFy4gLmmHcPdVRYLIDwOSF/bEf0VQRXg0Mwy
BnY0tp1GBZBvL74JLq5ygzRl/73k6vD4SHy16KrdWJDnJIB1jrNIUJBYGvLbBthC
L/sRfkhPdizd5bxKJCpfRobloJXhzU7NkXExt9bOFhKlC8auOOY4g4snJZDTU+1k
Y7lRH/Oz/60a4UiBsQYsbk1MYhwJ61Rh7K9kjs9HtIzrfJYFgX7j1qSnQow0l2g8
OYhPCHIcTbrqSDyt8pCfze0rqeAJkx8Up9jDK04/bB9Gd1N3maA=
=1sE0
-----END PGP SIGNATURE-----


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

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

untested:

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

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

--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmV1Z44ACgkQQarn3Mo9
g1Ev3g/+Myw2kbuk2L6bmmXiwCdrKBmnVrUfqptfFVO2tjCLWDZVy4Oatf5mFyID
nhiMm5zBSKGVpCtQ2MWgSn8gNsOj9V/z0ITOoaoyzNQfPdG7tCPycYQwd43a/uOg
2SUKxKx4K+L1+apfKFU1v3jZAa/BXukmjQFCzBbe6RsOjsEX7KUKeU+fjQWjkmDO
n3s9gWtmuntMdvBaoGd02HZV70j85q0KJKEpC+Ac1CDiGWlBYx+LTs9a3BxlIB0d
VF9F8M7JMzVhkE4VuI9PCLcXgTo2IXRxakqhpDA4eD1IIjN8Shy2Yx3Uy3A8tAkq
pQVBmlE4L+PrvEVmsPYRpt2iYKrx7yg7Sux1I/Hqw7HBzVYyuN6mPAq8XFMfneVE
44BC3GL9zcG1DIxBarcrrxnbaXQXhoaayA8yZol6fOPFd7V+zw51zyO6h1yHfjck
VSPjq2DSs42+tKWdfnHK6XOFZDmRU8ZDTm218fTT+yfm3XRSahE7+5ql6d4UBeJ9
WWhljWRtVPZZg+/3rM0O/7PM0svKyoEdhNNoXZ4luhgpISe7V0itw/PdqvkDHtX3
QLSi1l5vcMxXkbU9xvkF8+a0A+xXjRNUVbV1Wf/YUZd1qKomQm4TPi67sIVg56EA
fC7BTLZ0CCM4Wc26FXak+KgRRgU3Lfg2avWtWuQcn8Ujslwwz/g=
=e6cb
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 10 Dec 2023 11:14
Re: [bug#67686] [PATCH core-updates v2 4/7] DRAFT gnu: glibc: Update to 2.38.
(address . 67686@debbugs.gnu.org)(name . Janneke Nieuwenhuizen)(address . janneke@gnu.org)
87jzpm4b64.fsf@gnu.org
Ludovic Courtès <ludo@gnu.org> skribis:

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

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

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

Ludo’.
?
Your comment

This issue is archived.

To comment on this conversation send an email to 67686@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 67686
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch