From patchwork Tue Jul 19 14:12:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: zamfofex X-Patchwork-Id: 3791 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4E16C27BBEA; Tue, 19 Jul 2022 17:15:02 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4CBDE27BBE9 for ; Tue, 19 Jul 2022 17:15:01 +0100 (BST) Received: from localhost ([::1]:40416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDpsC-0000iE-EU for patchwork@mira.cbaines.net; Tue, 19 Jul 2022 12:15:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDpqI-0006xb-8u for guix-patches@gnu.org; Tue, 19 Jul 2022 12:13:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57250) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDpqH-00039d-W3 for guix-patches@gnu.org; Tue, 19 Jul 2022 12:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oDpqH-00035D-Rv for guix-patches@gnu.org; Tue, 19 Jul 2022 12:13:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54832] [patch] update glibc to 2.35 Resent-From: zamfofex Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Jul 2022 16:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54832 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: Maxime Devos , 54832@debbugs.gnu.org Received: via spool by 54832-submit@debbugs.gnu.org id=B54832.165824713611792 (code B ref 54832); Tue, 19 Jul 2022 16:13:01 +0000 Received: (at 54832) by debbugs.gnu.org; 19 Jul 2022 16:12:16 +0000 Received: from localhost ([127.0.0.1]:55007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDppV-000344-2R for submit@debbugs.gnu.org; Tue, 19 Jul 2022 12:12:16 -0400 Received: from mta-14-3.privateemail.com ([198.54.127.110]:34940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDny7-0008K6-Lj for 54832@debbugs.gnu.org; Tue, 19 Jul 2022 10:13:00 -0400 Received: from mta-14.privateemail.com (localhost [127.0.0.1]) by mta-14.privateemail.com (Postfix) with ESMTP id 91EAB18000AF; Tue, 19 Jul 2022 10:12:53 -0400 (EDT) Received: from APP-04 (unknown [10.50.14.154]) by mta-14.privateemail.com (Postfix) with ESMTPA id 5C5CD18000A2; Tue, 19 Jul 2022 10:12:51 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=twdb.moe; s=default; t=1658239973; bh=AQ04WfkfRowG82m/HFkzHE8NVAojQaL7DDI8dN2ib48=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=cHxeldqdgk2DZs5oBES4Z8oUc0dtRCdU0ZFsanfn46vHdp1toaKZa+eBb1SwG+JCp KiJwtQ0hPtMKs6Il2HtNvGCYi0py99qIdKKWckFA2GWt7hffZAAf3pKy9CATHtHBhL iVPu4QfyWjk6ataXLXv75yHrQmb3tdKSytTGKzp0HoJNnLjU4kUkqXMNHi+/IBEDCA 9hYjEQWgm0tFT0z1TuCtf+OC1NFQ6isIGhgNoUkA/o108kNoABbi8BdgYXJrRZljOV zcs5uywHBrHHGX4GZo4WlxXFI9q4x1ddvaR2/VtPIQF1bpbOPLUWFejhqTWakqtXX0 nf+FU1s6kTdkQ== Date: Tue, 19 Jul 2022 11:12:51 -0300 (BRT) From: zamfofex Message-ID: <1143838129.1375777.1658239971665@privateemail.com> In-Reply-To: <874jzg59zc.fsf_-_@gnu.org> References: <935236349.13698.1649553391613@privateemail.com> <87r14ubhyu.fsf@gnu.org> <818784149.855838.1654517187059@privateemail.com> <874jzg59zc.fsf_-_@gnu.org> MIME-Version: 1.0 X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.6-Rev16 X-Originating-Client: open-xchange-appsuite X-Virus-Scanned: ClamAV using ClamSMTP X-Mailman-Approved-At: Tue, 19 Jul 2022 12:12:11 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches > There’s a comment at the top of ‘glibc-dl-cache.patch’ that explains > what it does, but see > > for details. I can take a look and update it. It seems we both misinterpreted the diff I had sent originally, as that patch has not actually been removed, but rather its line was changed (it was moved upwards). So good news, no need for changes or further investigation! > We’d need a comment like “Keep empty .a files in OUT in addition to > STATIC because …”. I added a comment explaining the change! I hope it is enough. > [conversation about M4 changes] Apparently M4 has already been updated in core-updates by now! So that all of that has already been resolved. > Perfect. I realize upgrading glibc is a rather tricky task, so thanks > for giving it a try! Surely we can team up to get it past the finish > line. Thanks for the encouragement! However, since glibc 2.36 releases a few weeks from now, do you feel like it would make sense to wait until then to update it? I suppose it could always be updated again later, but I don’t know if that’s ideal. - - - Also, I could not figure out how to use ‘git prepare-patch’ or ‘git send-email’ properly, so I hope a ‘git diff’ attachment is enough. diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index cf640aa..0cd5d61 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2022 zamfofex ;;; ;;; This file is part of GNU Guix. ;;; @@ -709,16 +710,14 @@ (define-public glibc ;; version 2.28, GNU/Hurd used a different glibc branch. (package (name "glibc") - (version "2.33") + (version "2.35") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz")) (sha256 (base32 - "1zvp0qdfbdyqrzydz18d9zg3n5ygy8ps7cmny1bvsp8h1q05c99f")) - (patches (search-patches "glibc-ldd-powerpc.patch" - "glibc-ldd-x86_64.patch" - "glibc-dl-cache.patch" + "0bpm1kfi09dxl4c6aanc5c9951fmf6ckkzay60cx7k37dcpp68si")) + (patches (search-patches "glibc-dl-cache.patch" "glibc-versioned-locpath.patch" "glibc-allow-kernel-2.6.32.patch" "glibc-reinstate-prlimit64-fallback.patch" @@ -753,6 +752,7 @@ (define-public glibc #:validate-runpath? #f #:modules ((ice-9 ftw) + (srfi srfi-1) (srfi srfi-26) (guix build utils) (guix build gnu-build-system)) @@ -867,13 +867,34 @@ (define-public glibc (add-after 'install 'move-static-libs (lambda* (#:key outputs #:allow-other-keys) ;; Move static libraries to the "static" output. + ;; Note: As of GNU libc 2.34, the contents of some ".a" + ;; files have been moved into "libc.so", and *both* empty + ;; ".so" and ".a" files have been introduced to avoid + ;; breaking existing executables and existing builds + ;; respectively. The intent of the seemingly redundant + ;; empty ".a" files is to avoid newly-compiled executables + ;; from having dependencies on the empty shared libraries, + ;; 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. + (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)) + (define (static-library? file) ;; Return true if FILE is a static library. The ;; "_nonshared.a" files are referred to by libc.so, ;; libpthread.so, etc., which are in fact linker ;; scripts. (and (string-suffix? ".a" file) - (not (string-contains file "_nonshared")))) + (not (string-contains file "_nonshared")) + (not (empty-static-library? file)))) (define (linker-script? file) ;; Guess whether FILE, a ".a" file, is actually a @@ -884,6 +905,7 @@ (define (linker-script? file) (let* ((out (assoc-ref outputs "out")) (lib (string-append out "/lib")) (files (scandir lib static-library?)) + (files2 (scandir lib empty-static-library?)) (static (assoc-ref outputs "static")) (slib (string-append static "/lib"))) (mkdir-p slib) @@ -891,6 +913,10 @@ (define (linker-script? file) (rename-file (string-append lib "/" base) (string-append slib "/" base))) files) + (for-each (lambda (base) + (copy-file (string-append lib "/" base) + (string-append slib "/" base))) + files2) ;; Usually libm.a is a linker script so we need to ;; change the file names in there to refer to STATIC diff --git a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch index e31f99a..b022155 100644 --- a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch +++ b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch @@ -67,8 +67,8 @@ index fcd79fd554..1dd02aa449 100644 diff --git a/sysdeps/pthread/timer_create.c b/sysdeps/pthread/timer_create.c index 9d8a9ea8ae..3430582c09 100644 ---- a/sysdeps/pthread/timer_create.c -+++ b/sysdeps/pthread/timer_create.c +--- a/rt/timer_create.c ++++ b/rt/timer_create.c @@ -48,7 +48,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid) return -1; }