GNU bug report logs - #74676
[core-packages-team 5/5] DRAFT gnu: gcc: Update gcc, gcc-toolchain to 14.

Previous Next

Package: guix-patches;

Reported by: Janneke Nieuwenhuizen <janneke <at> gnu.org>

Date: Tue, 3 Dec 2024 21:08:02 UTC

Severity: normal

To reply to this bug, email your comments to 74676 AT debbugs.gnu.org.

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#74676; Package guix-patches. (Tue, 03 Dec 2024 21:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Janneke Nieuwenhuizen <janneke <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 03 Dec 2024 21:08:02 GMT) Full text and rfc822 format available.

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

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Andreas Enge <andreas <at> enge.fr>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Efraim Flashner <efraim <at> flashner.co.il>, Ekaitz Zarraga <ekaitz <at> elenq.tech>,
 Janneke Nieuwenhuizen <janneke <at> gnu.org>
Subject: [core-packages-team 5/5] DRAFT gnu: gcc: Update gcc, gcc-toolchain
 to 14.
Date: Tue, 03 Dec 2024 22:07:23 +0100
Hello,

So, I've just built "hello" for x86_64-linux on "core-packages-team"
(yay!) mostly re-using gcc-14 patches/workarounds that I created for the
Hurd.

We probably want to keep this [switch to gcc-14] patch "bubbling" up on
top of the gcc-14 patches until the gcc-14 transition is done, keeping
every commit buildable.

Just opening this bug by sendding this email to have a placeholder for
discussing this, for the patches see "core-packages-team" (hope that's
OK).

Anyway, I have been using variants of

--8<---------------cut here---------------start------------->8---
"CFLAGS=-g -O2 -Wno-implicit-function-declaration"
--8<---------------cut here---------------end--------------->8---

while Ludo in hot-patch mode this morning used the already somewhat nicer

--8<---------------cut here---------------start------------->8---
[-DCMAKE_}C_FLAGS=-Wno-error=implicit-function-declaration"
--8<---------------cut here---------------end--------------->8---

To get build gcc-final to build on the 64bit Hurd I finally created a
gcc.sh wrapper script, after trying all kinds of variations of CFLAGS,
CFLAGS_FOR_BUILD in #:configure-flags, #:make-flags, see also
<https://gcc.gnu.org/gcc-14/porting_to.html> where they even suggest
using "-fpermissive".

Before pointing the build farm to core-packages-team and starting the
"real work" we may want to think about how to go forward.  On the one
hand, having CFLAGS patches littered all over the place is not great, on
the other hand, if we were to add compatibility flags to a wrapper for
gcc, or into build systems, we may never get rid of such a "feature".
Thoughts?

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#74676; Package guix-patches. (Thu, 05 Dec 2024 19:46:02 GMT) Full text and rfc822 format available.

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

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Andreas Enge <andreas <at> enge.fr>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Efraim Flashner <efraim <at> flashner.co.il>, Ekaitz Zarraga <ekaitz <at> elenq.tech>
Subject: Re: [core-packages-team 5/5] DRAFT gnu: gcc: Update gcc,
 gcc-toolchain to 14.
Date: Thu, 05 Dec 2024 20:45:46 +0100
Janneke Nieuwenhuizen writes:

Hi,

> So, I've just built "hello" for x86_64-linux on "core-packages-team"
> (yay!) mostly re-using gcc-14 patches/workarounds that I created for the
> Hurd.

[..]

I've all but reconfigured--guix system reconfigure as non-root--my
system, without childhurd, using what is now core-packages-team-old.
That really wasn't so bad, many packages just build with gcc-14.

I have tried to keep the scope of changes as small as possible but
attempted to "fix" packages build failures also by upgrading the
package.  For commencement and base packages I kept the scope narrow:
x86_64-linux, because it has proven to be very hard to predict what's
needed on other architectures.  For other packages, such as "zip", I
just added the mostly harmless -Wno-implicit-function-declaration flag
unguarded.

The *-old branch has a couple of hacks that neutralize impact to
commencement packages, marked "REMOVEME", to avoid world rebuilds as
sometimes some base package builds in commencement, but fails to build
lateron.

The new, cleaned-up, and rebased core-packages-team branch is as such
untested, but "should work".  WDYT?  Can we point the build-farm to this
branch to help out?

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#74676; Package guix-patches. (Sun, 08 Dec 2024 18:14:01 GMT) Full text and rfc822 format available.

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

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Andreas Enge <andreas <at> enge.fr>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Efraim Flashner <efraim <at> flashner.co.il>, Ekaitz Zarraga <ekaitz <at> elenq.tech>
Subject: Re: [core-packages-team 5/5] DRAFT gnu: gcc: Update gcc,
 gcc-toolchain to 14.
Date: Sun, 08 Dec 2024 19:13:08 +0100
Janneke Nieuwenhuizen writes:

Hi,

>> So, I've just built "hello" for x86_64-linux on "core-packages-team"
>> (yay!) mostly re-using gcc-14 patches/workarounds that I created for the
>> Hurd.
>
> [..]
>
> I've all but reconfigured--guix system reconfigure

That was apparently not true, somewhere in the process I somehow built from
another branch.  Anyway, still making good progress.... :-/

On IRC, Efraim reports that i686-linux and aarch64-linux fail to build
hello on current core-packages-team.  That makes me reconsider whether
this strategy

> I kept the scope narrow: x86_64-linux, because it has proven to be
> very hard to predict what's needed on other architectures.

which makes a lot of sense for patches that go to "master" is a good
strategy for core-packages-team.  Possibly it's better to use an
unlimited scope?  Oh well.

Greetings,
Janneke -- building /gnu/store/m5m6qzlxypk1y58yp69501rhq5qmz3r4-llvm-18.1.8.drv...

-- 
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#74676; Package guix-patches. (Mon, 16 Dec 2024 21:45:02 GMT) Full text and rfc822 format available.

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

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Andreas Enge <andreas <at> enge.fr>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Efraim Flashner <efraim <at> flashner.co.il>, Ekaitz Zarraga <ekaitz <at> elenq.tech>
Subject: Re: [core-packages-team 5/5] DRAFT gnu: gcc: Update gcc,
 gcc-toolchain to 14.
Date: Mon, 16 Dec 2024 22:43:53 +0100
Janneke Nieuwenhuizen writes:

Hello,

>>> So, I've just built "hello" for x86_64-linux on "core-packages-team"
>>> (yay!) mostly re-using gcc-14 patches/workarounds that I created for the
>>> Hurd.
>>
>> [..]
>>
>> I've all but reconfigured--guix system reconfigure
>
> That was apparently not true, somewhere in the process I somehow built from
> another branch.  Anyway, still making good progress.... :-/
>
> On IRC, Efraim reports that i686-linux and aarch64-linux fail to build
> hello on current core-packages-team.  That makes me reconsider whether
> this strategy
>
>> I kept the scope narrow: x86_64-linux, because it has proven to be
>> very hard to predict what's needed on other architectures.
>
> which makes a lot of sense for patches that go to "master" is a good
> strategy for core-packages-team.  Possibly it's better to use an
> unlimited scope?  Oh well.

The current core-packages-team uses the gcc and bash fixes for all
platforms and now also supports building all gcc versions from 4.8 and
up, and I've just built hello again for x86_64-linux.

I've built the rust bootstrap several times already, guess I'll just go
for a new round.  But this time we can maybeu "cheat" with packages that
are too difficult to build, and build them with another gcc version than
14?

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#74676; Package guix-patches. (Thu, 26 Dec 2024 11:08:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Janneke Nieuwenhuizen <janneke <at> gnu.org>
Cc: Ekaitz Zarraga <ekaitz <at> elenq.tech>, Andreas Enge <andreas <at> enge.fr>,
 Efraim Flashner <efraim <at> flashner.co.il>, guix-patches <at> gnu.org
Subject: Re: [core-packages-team 5/5] DRAFT gnu: gcc: Update gcc,
 gcc-toolchain to 14.
Date: Thu, 26 Dec 2024 12:07:46 +0100
Hi,

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

> I've built the rust bootstrap several times already, guess I'll just go
> for a new round.  But this time we can maybeu "cheat" with packages that
> are too difficult to build, and build them with another gcc version than
> 14?

I haven’t followed closely (sorry!), but if it’s just a matter of adding
‘gcc-11’ (say) as a native input for a couple of packages, that’s
probably okay.  Except perhaps for C libraries, because then we could
end up with programs depending on two difference versions of libgcc_s.so
& co.

Ludo’.




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

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Janneke Nieuwenhuizen <janneke <at> gnu.org>
Cc: 74676 <at> debbugs.gnu.org, Andreas Enge <andreas <at> enge.fr>,
 Efraim Flashner <efraim <at> flashner.co.il>, Ekaitz Zarraga <ekaitz <at> elenq.tech>
Subject: Re: bug#74676: [core-packages-team 5/5] DRAFT gnu: gcc: Update gcc,
 gcc-toolchain to 14.
Date: Sun, 29 Dec 2024 16:05:34 +0100
Hello,

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

> Before pointing the build farm to core-packages-team and starting the
> "real work" we may want to think about how to go forward.  On the one
> hand, having CFLAGS patches littered all over the place is not great, on
> the other hand, if we were to add compatibility flags to a wrapper for
> gcc, or into build systems, we may never get rid of such a "feature".
> Thoughts?

The -Wno-implicit-function-declaration CFLAGS/patches all around are not
pretty, but they’ll vanish over time.

A wrapper would be problematic for the reason you give notably.  (In the
early days of Guix, I tried really hard to avoid compiler wrappers,
which is what Nixpkgs has, to remain as close as possible to the
toolchain and to avoid “invisible magic” afforded by wrappers.)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#74676; Package guix-patches. (Mon, 06 Jan 2025 13:31:02 GMT) Full text and rfc822 format available.

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

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Ekaitz Zarraga <ekaitz <at> elenq.tech>, Andreas Enge <andreas <at> enge.fr>,
 Efraim Flashner <efraim <at> flashner.co.il>, guix-patches <at> gnu.org
Subject: Re: [core-packages-team 5/5] DRAFT gnu: gcc: Update gcc,
 gcc-toolchain to 14.
Date: Mon, 06 Jan 2025 14:30:03 +0100
Ludovic Courtès writes:

Hi,

> Janneke Nieuwenhuizen <janneke <at> gnu.org> skribis:
>
>> I've built the rust bootstrap several times already, guess I'll just go
>> for a new round.  But this time we can maybeu "cheat" with packages that
>> are too difficult to build, and build them with another gcc version than
>> 14?
>
> I haven’t followed closely (sorry!), but if it’s just a matter of adding
> ‘gcc-11’ (say) as a native input for a couple of packages, that’s
> probably okay.  Except perhaps for C libraries, because then we could
> end up with programs depending on two difference versions of libgcc_s.so
> & co.

Right.  I found that for c++ packages it's also tricky.   Anyway, at the
moment we have

--8<---------------cut here---------------start------------->8---
1198e662af gnu: clang-runtime-17: Build with gcc-13.
eef34a6748 gnu: clang-runtime-18: Build with gcc-13.
bf33f0022e gnu: python-cython-next: Build with gcc-13.
0ae054278b gnu: ghc-8.4.4: Build with gcc-13.
5e65c4721a gnu: ghc-8.0.2: Build with gcc-13.
804a75c785 gnu: perl-tk: Build with gcc-12.
269da0d77f gnu: json-c-0.13: Fix build with gcc-13.
68545a30d7 gnu: gavl: Fix build by using gcc-13.
--8<---------------cut here---------------end--------------->8---

Silly but just the other day I realised why using a non-gcc-14 is so
problematic: we won't have that package (or any of its dependencies) on
the Hurd :).

Especially ghc might be problematic, but I spent a lot of time trying to
set relaxing CFLAGS (-copt-Wno-error=...) on every necessary build
"level" and got bored of the slow feedback cycle ("it didn't build").

Otoh, possibly things may improve before we really need these packages
on the Hurd and possibly others have more helpful ideas for fixing a
certain package.

I'm a bit puzzled that ci.guix.gnu.org says 81% success, that cannot be
right?  Sure, I worked very hard and we only have x86_64-linux and
i686-linux enabled atm but still?

FWIW, I just built libstd++ on aarch64 too :)

I also included (and reverted for now to avoid a world rebuild, so still
pretty much untested atm)

--8<---------------cut here---------------start------------->8---
ed4c3760fc gexp: Improve support of Unicode characters.
--8<---------------cut here---------------end--------------->8---

from <https://issues.guix.gnu.org/73660> that seems OK but IWBN if
someone could have a look at that.

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#74676; Package guix-patches. (Sun, 12 Jan 2025 15:17:03 GMT) Full text and rfc822 format available.

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

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: 74676 <at> debbugs.gnu.org
Subject: Request for merging core-packages-team branch
Date: Sun, 12 Jan 2025 16:16:23 +0100
Hi!

Cuirass says we're at 81% success rate for i686-linux and x86_64-linux,
and possibly my #74676, meant as an old style "please help with the
gcc-14 transition", should have been named "Request for merging" already
anyway.  Hard to keep up with all the changes but more formality is a
good thing I guess :)

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#74676; Package guix-patches. (Sun, 12 Jan 2025 15:34:02 GMT) Full text and rfc822 format available.

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

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: 74676 <at> debbugs.gnu.org, 75517 <at> debbugs.gnu.org
Subject: Request for merging "core-packages-team" branch
Date: Sun, 12 Jan 2025 16:32:46 +0100
Hi!

Cuirass says we're at 81% success rate for i686-linux and x86_64-linux,
and possibly my #74676, meant as an old style "please help with the
gcc-14 transition", should have been named "Request for merging" already
anyway.  Hard to keep up with all the changes but more formality is a
good thing I guess :)

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#74676; Package guix-patches. (Sun, 12 Jan 2025 15:38:01 GMT) Full text and rfc822 format available.

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

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: 75517-done <at> debbugs.gnu.org
Cc: 74676 <at> debbugs.gnu.org, 75518 <at> debbugs.gnu.org
Subject: Re: bug#75517: Request for merging core-packages-team branch
Date: Sun, 12 Jan 2025 16:37:27 +0100
Janneke Nieuwenhuizen writes:

Closing this bug with wrong subject (missing double quotes around branch name).

-- 
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#74676; Package guix-patches. (Sat, 18 Jan 2025 16:33:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Janneke Nieuwenhuizen <janneke <at> gnu.org>
Cc: 74676 <at> debbugs.gnu.org, 75517 <at> debbugs.gnu.org, 75518 <at> debbugs.gnu.org
Subject: Re: bug#75518: Request for merging "core-packages-team" branch
Date: Sat, 18 Jan 2025 17:32:09 +0100
[Message part 1 (text/plain, inline)]
Hello!

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

> Cuirass says we're at 81% success rate for i686-linux and x86_64-linux,
> and possibly my #74676, meant as an old style "please help with the
> gcc-14 transition", should have been named "Request for merging" already
> anyway.  Hard to keep up with all the changes but more formality is a
> good thing I guess :)

I’m testing the patch below to upgrade glibc to 2.40 (I’m at
‘gcc-mesboot-4.9.4’ so there are still quite a few hours before I get
around to building glibc).

I think we must upgrade glibc in this branch because (1) we want to get
rid of this graft and more generally get the latest fixes, and (2) we
cannot just ungraft since the graft uses ‘git-fetch’, which cannot be
relied on in ‘commencement.scm’ (we still assume that
‘builtin:git-download’ may be unavailable, and when it’s unavailable, we
have a circular dependency).

Thoughts?

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/local.mk b/gnu/local.mk
index f4d04c4abb..3b123cba1d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2012-2024 Ludovic Courtès <ludo <at> gnu.org>
+# Copyright © 2012-2025 Ludovic Courtès <ludo <at> gnu.org>
 # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2022, 2023, 2024 Andreas Enge <andreas <at> enge.fr>
 # Copyright © 2016 Mathieu Lirzin <mthl <at> gnu.org>
 # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver <mhw <at> netris.org>
@@ -1437,6 +1437,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/glibc-2.33-riscv64-miscompilation.patch	\
   %D%/packages/patches/glibc-2.39-git-updates.patch	\
   %D%/packages/patches/glibc-2.39-fmod-libm-a.patch		\
+  %D%/packages/patches/glibc-2.40-dl-cache.patch		\
   %D%/packages/patches/glibc-CVE-2019-7309.patch		\
   %D%/packages/patches/glibc-CVE-2019-9169.patch		\
   %D%/packages/patches/glibc-CVE-2019-19126.patch		\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index fc48c9d844..95c237e140 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012-2024 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2012-2025 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2014, 2019 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2012 Nikita Karetnikov <nikita <at> karetnikov.org>
 ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw <at> netris.org>
@@ -879,10 +879,9 @@ (define* (make-ld-wrapper name #:key
     (license gpl3+)))
 
 (define %glibc-patches
-  (list "glibc-2.39-git-updates.patch"
-        "glibc-ldd-powerpc.patch"
+  (list "glibc-ldd-powerpc.patch"
         "glibc-2.38-ldd-x86_64.patch"
-        "glibc-dl-cache.patch"
+        "glibc-2.40-dl-cache.patch"
         "glibc-2.37-versioned-locpath.patch"
         ;; "glibc-allow-kernel-2.6.32.patch"
         "glibc-reinstate-prlimit64-fallback.patch"
@@ -898,18 +897,17 @@ (define-public glibc
   ;; version 2.28, GNU/Hurd used a different glibc branch.
   (package
    (name "glibc")
-   (version "2.39")
+   (version "2.40")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
             (sha256
              (base32
-              "09nrwb0ksbah9k35jchd28xxp2hidilqdgz7b8v5f30pz1yd8yzp"))
+              "18h50b0zm8dkpzj81w033v99rbxiykk3v697yr4dfqwjbqbr1a0r"))
             (patches (map search-patch %glibc-patches))))
    (properties `((lint-hidden-cve . ("CVE-2024-2961"
                                      "CVE-2024-33601" "CVE-2024-33602"
                                      "CVE-2024-33600" "CVE-2024-33599"))))
-   (replacement glibc/fixed)
    (build-system gnu-build-system)
 
    ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
@@ -1187,28 +1185,6 @@ (define-public glibc
    (license lgpl2.0+)
    (home-page "https://www.gnu.org/software/libc/")))
 
-(define glibc/fixed
-  (package
-    (inherit glibc)
-    (name "glibc")
-    (version (package-version glibc))
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "git://sourceware.org/git/glibc.git")
-                    ;; This is the latest commit from the
-                    ;; 'release/2.39/master' branch, where CVEs and other
-                    ;; important bug fixes are cherry picked.
-                    (commit "2c882bf9c15d206aaf04766d1b8e3ae5b1002cc2")))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "111yf24g0qcfcxywfzrilmjxysahlbkzxfimcz9rq8p00qzvvf51"))
-              (patches (map search-patch
-                            (fold (cut delete <...>)
-                                  %glibc-patches
-                                  '("glibc-2.39-git-updates.patch"))))))))
-
 ;; Define a variation of glibc which uses the default /etc/ld.so.cache, useful
 ;; in FHS containers.
 (define-public glibc-for-fhs
@@ -1220,7 +1196,7 @@ (define-public glibc-for-fhs
                      ;; directories, re-enabling the default /etc/ld.so.cache
                      ;; behavior.
                      (patches
-                      (delete (search-patch "glibc-dl-cache.patch")
+                      (delete (search-patch "glibc-2.40-dl-cache.patch")
                               (origin-patches (package-source glibc)))))))))
 
 ;; Below are old libc versions, which we use mostly to build locale data in
@@ -1444,7 +1420,6 @@ (define-public glibc-2.29
                                        "glibc-ldd-x86_64.patch"
                                        "glibc-CVE-2019-7309.patch"
                                        "glibc-CVE-2019-9169.patch"
-                                       "glibc-2.29-git-updates.patch"
                                        "glibc-hidden-visibility-ldconfig.patch"
                                        "glibc-versioned-locpath.patch"
                                        "glibc-allow-kernel-2.6.32.patch"
diff --git a/gnu/packages/patches/glibc-2.40-dl-cache.patch b/gnu/packages/patches/glibc-2.40-dl-cache.patch
new file mode 100644
index 0000000000..d41faa5225
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.40-dl-cache.patch
@@ -0,0 +1,113 @@
+Read the shared library cache relative to $ORIGIN instead of reading
+from /etc/ld.so.cache.  Also arrange so that this cache takes
+precedence over RUNPATH.
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 7c7dc587..19d1d79a 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -374,6 +374,52 @@ _dl_cache_libcmp (const char *p1, const char *p2)
+   return *p1 - *p2;
+ }
+ 
++/* Special value representing the lack of an ld.so cache.  */
++static const char ld_so_cache_lacking[] = "/ld.so cache is lacking";
++
++/* Return the per-application ld.so cache, relative to $ORIGIN, or NULL if
++   that fails for some reason.  Do not return the system-wide LD_SO_CACHE
++   since on a foreign distro it would contain invalid information.  */
++static const char *
++ld_so_cache (void)
++{
++  static const char *loader_cache;
++
++  if (loader_cache == NULL)
++    {
++      static const char store[] = @STORE_DIRECTORY@;
++      const char *origin = _dl_get_origin ();
++
++      /* Check whether ORIGIN is something like "/gnu/store/…-foo/bin".  */
++      if (origin != (char *) -1   /* _dl_get_origin reported failure */
++	  && strncmp (store, origin, strlen (store)) == 0
++	  && origin[sizeof store - 1] == '/')
++	{
++	  char *store_item_end = strchr (origin + sizeof store, '/');
++
++	  if (store_item_end != NULL)
++	    {
++	      static const char suffix[] = "/etc/ld.so.cache";
++	      size_t store_item_len = store_item_end - origin;
++
++	      /* Note: We can't use 'malloc' because it can be interposed.
++		 Likewise, 'strncpy' is not available.  */
++	      char *cache = alloca (strlen (origin) + sizeof suffix);
++
++	      strcpy (cache, origin);
++	      strcpy (cache + store_item_len, suffix);
++
++	      loader_cache = __strdup (cache) ?: ld_so_cache_lacking;
++	    }
++	  else
++	    loader_cache = ld_so_cache_lacking;
++	}
++      else
++	loader_cache = ld_so_cache_lacking;
++    }
++
++  return loader_cache;
++}
+ 
+ /* Look up NAME in ld.so.cache and return the file name stored there, or null
+    if none is found.  The cache is loaded if it was not already.  If loading
+@@ -387,12 +433,15 @@ _dl_load_cache_lookup (const char *name)
+ {
+   /* Print a message if the loading of libs is traced.  */
+   if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
+-    _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
++    _dl_debug_printf (" search cache=%s\n", ld_so_cache ());
++
++  if (__glibc_unlikely (ld_so_cache () == ld_so_cache_lacking))
++    return NULL;
+ 
+   if (cache == NULL)
+     {
+       /* Read the contents of the file.  */
+-      void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
++      void *file = _dl_sysdep_read_whole_file (ld_so_cache (), &cachesize,
+ 					       PROT_READ);
+ 
+       /* We can handle three different cache file formats here:
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index 8a89b710..b8802e74 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -2038,14 +2038,6 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 			loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
+ 			LA_SER_LIBPATH, &found_other_class);
+ 
+-      /* Look at the RUNPATH information for this binary.  */
+-      if (fd == -1 && loader != NULL
+-	  && cache_rpath (loader, &loader->l_runpath_dirs,
+-			  DT_RUNPATH, "RUNPATH"))
+-	fd = open_path (name, namelen, mode,
+-			&loader->l_runpath_dirs, &realname, &fb, loader,
+-			LA_SER_RUNPATH, &found_other_class);
+-
+ #ifdef USE_LDCONFIG
+       if (fd == -1
+ 	  && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
+@@ -2104,6 +2096,14 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 	}
+ #endif
+ 
++      /* Look at the RUNPATH information for this binary.  */
++      if (fd == -1 && loader != NULL
++	  && cache_rpath (loader, &loader->l_runpath_dirs,
++			  DT_RUNPATH, "RUNPATH"))
++	fd = open_path (name, namelen, mode,
++			&loader->l_runpath_dirs, &realname, &fb, loader,
++			LA_SER_RUNPATH, &found_other_class);
++
+       /* Finally, try the default path.  */
+       if (fd == -1
+ 	  && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL

Information forwarded to guix-patches <at> gnu.org:
bug#74676; Package guix-patches. (Sat, 18 Jan 2025 16:51:01 GMT) Full text and rfc822 format available.

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

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 74676 <at> debbugs.gnu.org, 75517 <at> debbugs.gnu.org, 75518 <at> debbugs.gnu.org
Subject: Re: bug#75518: Request for merging "core-packages-team" branch
Date: Sat, 18 Jan 2025 17:49:53 +0100
Ludovic Courtès writes:

Hi!

> Janneke Nieuwenhuizen <janneke <at> gnu.org> skribis:
>
>> Cuirass says we're at 81% success rate for i686-linux and x86_64-linux,
>> and possibly my #74676, meant as an old style "please help with the
>> gcc-14 transition", should have been named "Request for merging" already
>> anyway.  Hard to keep up with all the changes but more formality is a
>> good thing I guess :)
>
> I’m testing the patch below to upgrade glibc to 2.40 (I’m at
> ‘gcc-mesboot-4.9.4’ so there are still quite a few hours before I get
> around to building glibc).

Oh, I didn't realise 2.40 was out already!

> I think we must upgrade glibc in this branch because (1) we want to get
> rid of this graft and more generally get the latest fixes, and (2) we
> cannot just ungraft since the graft uses ‘git-fetch’, which cannot be
> relied on in ‘commencement.scm’ (we still assume that
> ‘builtin:git-download’ may be unavailable, and when it’s unavailable, we
> have a circular dependency).
>
> Thoughts?

That would be lovely, especially if it builds :)

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#74676; Package guix-patches. (Sun, 19 Jan 2025 23:41:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Janneke Nieuwenhuizen <janneke <at> gnu.org>
Cc: 74676 <at> debbugs.gnu.org, 75517 <at> debbugs.gnu.org, 75518 <at> debbugs.gnu.org
Subject: Re: bug#75518: Request for merging "core-packages-team" branch
Date: Mon, 20 Jan 2025 00:39:25 +0100
Hello,

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

> That would be lovely, especially if it builds :)

It actually does! :-) I went a bit further and tried “guix build
coreutils”.  It’s close to completion right now, but I’m going to bed.

I’m confident: unlike previous upgrades, there are no major deprecations
like the removal of Sun RPC, libutil.so, libcrypt.so, etc. (there’s not
much left to remove :-)).

So, pushed.  The one thing that still needs to be tested is
(cross-)compilation to GNU/Hurd.  There are probably patches that can be
dropped there.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#74676; Package guix-patches. (Fri, 31 Jan 2025 09:17:02 GMT) Full text and rfc822 format available.

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

From: 宋文武 <iyzsong <at> envs.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 74676 <at> debbugs.gnu.org, 75517 <at> debbugs.gnu.org, 75518 <at> debbugs.gnu.org,
 Janneke Nieuwenhuizen <janneke <at> gnu.org>
Subject: Re: [bug#75518] Request for merging "core-packages-team" branch
Date: Fri, 31 Jan 2025 17:20:18 +0800
Hello, I just merged 'xorg-updates', now this is the next in the queue.




This bug report was last modified 135 days ago.

Previous Next


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