From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id WDqcNZ5NcmXtKQEAauVa8A:P1 (envelope-from ) for ; Thu, 07 Dec 2023 23:56:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WDqcNZ5NcmXtKQEAauVa8A (envelope-from ) for ; Thu, 07 Dec 2023 23:56:30 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 98C9B64FA9 for ; Thu, 7 Dec 2023 23:56:30 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=g9q6jtkr; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701989790; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=I4VvSDLlifodOFRQLF6uT8NNYME3xKVmABE/CmmAdC4=; b=WItNVaocz7fiVCEleI2um3mM2pSNqtmYL62ow1O0vJ3SNZqyHIXZz5fgwdPA6mb1amwX/2 R0Jy0577QbQ1qjsOz2hC8dOINqOeXxJGrpiyzBM1SobMEoSCI8VGS1S89Yb3zV/T0W4Taw 4sMc2Wo+PliQ0bop/ocmJG8q9Qz9qJ1C7ekCC7jieyaTFoGduaeFZ4fPrqdKKrjO+wgMKt MESplerYqXr0Z5OhIWxIKRUQkkrdZhdBAbT4JY8tqGWEmprxFznF1mSAqGArZW1vasH7BZ i7nHqw5X9uFVxhxMHYuh/615RwMguQGhD+EwF3LpnwNVcmhwhfXqPob4hy5wmg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=g9q6jtkr; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701989790; a=rsa-sha256; cv=none; b=lnLKrDLgHFuls6uyOLsJQxoVR5Yla8nuqfMUG21+IZ8nY3wCL6NDTx8NgZ0GrqK6O6gXIS PUrm9gihsF+2Xa7+6Er9dxOpUOW+4RzBKDyHvUuI648Q/mRxYGoMMOIJQ3g4Zbpys4Kuqh AwnU4wvhd+TF2nMydk3rE+p1I2oHeIJDDj64175gB5D8+AlkHLXHZ4IrODeM6wG3wuBCwl B+WIF5wU3b++g1/6T51yDAHrwltSN5HqcAYBKIv4iX7+GBfH3lT8+ZleAPp+jGdjXRqyo+ iCWjG7owLGCElvcDCfRq2BYtH76Sv6Mu7qPjcYONXkBNu94Bd3neoL4D8peJUg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBNHj-0000Zh-3J; Thu, 07 Dec 2023 17:55:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBNHe-0000Rn-G1 for guix-patches@gnu.org; Thu, 07 Dec 2023 17:55:54 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBNHc-0002gt-Oq for guix-patches@gnu.org; Thu, 07 Dec 2023 17:55:53 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBNHp-0006tZ-AU for guix-patches@gnu.org; Thu, 07 Dec 2023 17:56:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67686] [PATCH core-updates v2 7/7] gnu: glibc: Improve handling of empty .a files. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 07 Dec 2023 22:56:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67686 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67686@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 67686-submit@debbugs.gnu.org id=B67686.170198971626349 (code B ref 67686); Thu, 07 Dec 2023 22:56:05 +0000 Received: (at 67686) by debbugs.gnu.org; 7 Dec 2023 22:55:16 +0000 Received: from localhost ([127.0.0.1]:43355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBNH1-0006qr-UF for submit@debbugs.gnu.org; Thu, 07 Dec 2023 17:55:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBNGx-0006pB-IZ for 67686@debbugs.gnu.org; Thu, 07 Dec 2023 17:55:11 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBNGf-0002KA-MX; Thu, 07 Dec 2023 17:54:53 -0500 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=I4VvSDLlifodOFRQLF6uT8NNYME3xKVmABE/CmmAdC4=; b=g9q6jtkr9nOGFpE23xN7 tCysFavP39lnsL4YgevsPA6Rr/eCZCUVjlfb/RMZ7SXZuMRIYozT/DASIOs+RfEOO6QTF9EtbMcLS x8N55vglezN1YPxbIvGR42xll7Bah3IQyD6dcP9JpEc46Ofr3MUOW8fPmnYuF4yqI/RzSOghG61iJ zsZIjoQBqEm1sX+r2SS7j9eQP24HYnk3jF6qJumpuWDuljqGmP1LWamE76wQ04zp4VbEPnTMbMqoF cd4e+JBgvAoYxOIWZOCTXFaAGl+Igc2xp/68j1eaqb0mxooS9QF14AmoqH3vo+yfpuABcPAwScz2S lrQ4F/Qs5QOQzQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 7 Dec 2023 23:54:10 +0100 Message-ID: <937aa63bbbbe688c12b9622150140f7739a63618.1701989279.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 98C9B64FA9 X-Spam-Score: -5.85 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -5.85 X-TUID: T5oratqcWOhu This partially reverts 3b2de6529b9d77c8a74d431859a3ec334e9603c2, itself a followup to 25b30622b4a77cd4b2965b9d62fa310a22413d54. * gnu/packages/base.scm (glibc)[arguments]: In ‘move-static-libs’ phase, remove ‘empty-static-libraries’ variable and rewrite ‘empty-static-library?’ to check file type and size. * gnu/packages/commencement.scm (make-gcc-toolchain): Remove ‘copy-file’ call to create ‘librt.a’. Change-Id: I33c6825d5b1e6e790dfff494bac1da07d3389e77 --- gnu/packages/base.scm | 18 ++++++------------ gnu/packages/commencement.scm | 10 +--------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 1144110309..311d598c8e 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -968,19 +968,13 @@ (define-public glibc ;; and as such, it is useful to have these ".a" files in ;; OUT in addition to STATIC. - ;; XXX: It might be better to determine whether a static - ;; library is empty by some criterion (such as their file - ;; size equaling eight bytes) rather than hardcoding them - ;; by name. - - ;; XXX: We forgot librt.a for the current version! In - ;; the meantime, gcc-toolchain provides it, but remove - ;; that fix once librt.a is added here. - (define empty-static-libraries - '("libpthread.a" "libdl.a" "libutil.a" "libanl.a")) (define (empty-static-library? file) - (any (lambda (s) - (string=? file s)) empty-static-libraries)) + ;; Return true if FILE is an 'ar' archive with nothing + ;; beyond the header. + (let ((file (string-append (assoc-ref outputs "out") + "/lib/" file))) + (and (ar-file? file) + (= (stat:size (stat file)) 8)))) (define (static-library? file) ;; Return true if FILE is a static library. The diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 4ccbbb0881..6c0f295f30 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3569,15 +3569,7 @@ (define* (make-gcc-toolchain gcc "libc-debug"))) (union-build (assoc-ref %outputs "static") (list (assoc-ref %build-inputs - "libc-static"))) - ;; XXX Remove once an empty librt.a is added to - ;; libc:out. - (copy-file - (string-append (assoc-ref %outputs "out") - "/lib/libpthread.a") - (string-append (assoc-ref %outputs "out") - "/lib/librt.a")) - #t)))) + "libc-static"))))))) (native-search-paths (append (package-native-search-paths gcc) -- 2.41.0