From patchwork Thu Sep 1 22:29:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 42130 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 9A5CF27BBEA; Thu, 1 Sep 2022 23:31:15 +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 E45F027BBE9 for ; Thu, 1 Sep 2022 23:31:14 +0100 (BST) Received: from localhost ([::1]:50498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTsiQ-0005VA-1L for patchwork@mira.cbaines.net; Thu, 01 Sep 2022 18:31:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTsiE-0005UN-HU for guix-patches@gnu.org; Thu, 01 Sep 2022 18:31:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTsiE-0005ZG-9J for guix-patches@gnu.org; Thu, 01 Sep 2022 18:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTsiE-00035s-1o for guix-patches@gnu.org; Thu, 01 Sep 2022 18:31:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57533] [PATCH core-updates 1/5] gnu: glibc: Update to 2.35. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 01 Sep 2022 22:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57533 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57533@debbugs.gnu.org Cc: zamfofex Received: via spool by 57533-submit@debbugs.gnu.org id=B57533.166207141011759 (code B ref 57533); Thu, 01 Sep 2022 22:31:02 +0000 Received: (at 57533) by debbugs.gnu.org; 1 Sep 2022 22:30:10 +0000 Received: from localhost ([127.0.0.1]:44329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTshN-00033Z-N8 for submit@debbugs.gnu.org; Thu, 01 Sep 2022 18:30:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTshM-00032I-1S for 57533@debbugs.gnu.org; Thu, 01 Sep 2022 18:30:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTshG-00058h-JI; Thu, 01 Sep 2022 18:30:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=4LJZ2BWZGmzOPt/uI9ngVQkEISK8bbzGHgxib9UIvKI=; b=YMUXuU/SPrrsO7f84Xva 0dAP2V15qCbKdJ4s84c9rfUdadAkcKnyP3jwB74vJmBoKSPOj5uhAdSVRswdW+5j0VQFjybheNW+4 DIuHfOc5ad1YnidZJ2nlWKOu8shebZ7xFL00syaeWt3WknM8+w/vIA4byFXz+i0f3t3vFgb57OF9i A+lLiklS07V0O87bT9s/BpzUNVPiY4TOtxNpn01tLnfZfeQLp5P/PMFRzEjEpooafAhuCbjCYAqWS yTGxENVKBQv9CUQElirfdNyqQWD6NavxeNYQPovywEKQiIXkc9LBMV8FGkQTmfRlfR4N/Efgdij+g 5wEj6OQSyJJpkA==; Received: from [84.214.173.6] (port=40078 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTshF-0001Su-IX; Thu, 01 Sep 2022 18:30:02 -0400 From: Marius Bakke Date: Fri, 2 Sep 2022 00:29:53 +0200 Message-Id: <20220901222957.15383-1-marius@gnu.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220901222413.14482-1-marius@gnu.org> References: <20220901222413.14482-1-marius@gnu.org> MIME-Version: 1.0 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 From: zamfofex * gnu/packages/base.scm (glibc): Update to 2.35. [arguments]: Handle empty library files. * gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch: Adjust for renamed file. Signed-off-by: Marius Bakke --- gnu/packages/base.scm | 34 +++++++++++++++++-- .../glibc-hurd-clock_gettime_monotonic.patch | 4 +-- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index cf640aad25..157cba5ff4 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,13 +710,13 @@ (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")) + "0bpm1kfi09dxl4c6aanc5c9951fmf6ckkzay60cx7k37dcpp68si")) (patches (search-patches "glibc-ldd-powerpc.patch" "glibc-ldd-x86_64.patch" "glibc-dl-cache.patch" @@ -753,6 +754,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 +869,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 +907,7 @@ (define (linker-script? file) (let* ((out (assoc-ref outputs "out")) (lib (string-append out "/lib")) (files (scandir lib static-library?)) + (empty (scandir lib empty-static-library?)) (static (assoc-ref outputs "static")) (slib (string-append static "/lib"))) (mkdir-p slib) @@ -891,6 +915,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))) + empty) ;; 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 e31f99a1ce..b02215550d 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; }