From patchwork Sat Nov 28 10:24:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 25402 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 4563127BBF9; Sat, 28 Nov 2020 10:25:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CBA0B27BBF8 for ; Sat, 28 Nov 2020 10:25:22 +0000 (GMT) Received: from localhost ([::1]:35120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kixPu-0002uA-1j for patchwork@mira.cbaines.net; Sat, 28 Nov 2020 05:25:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kixPb-0002WZ-Qa for guix-patches@gnu.org; Sat, 28 Nov 2020 05:25:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35447) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kixPb-0002eI-J9 for guix-patches@gnu.org; Sat, 28 Nov 2020 05:25:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kixPb-0006tj-Fh for guix-patches@gnu.org; Sat, 28 Nov 2020 05:25:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44899] [PATCH v2 0/4] Using 'ld.so.cache' to speed up application startup Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 28 Nov 2020 10:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44899 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44899@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 44899-submit@debbugs.gnu.org id=B44899.160655909326461 (code B ref 44899); Sat, 28 Nov 2020 10:25:03 +0000 Received: (at 44899) by debbugs.gnu.org; 28 Nov 2020 10:24:53 +0000 Received: from localhost ([127.0.0.1]:46986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kixPN-0006sV-Bl for submit@debbugs.gnu.org; Sat, 28 Nov 2020 05:24:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kixPE-0006rN-QP for 44899@debbugs.gnu.org; Sat, 28 Nov 2020 05:24:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42759) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kixP7-0002Sv-VL; Sat, 28 Nov 2020 05:24:33 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49898 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kixP7-0000YV-G6; Sat, 28 Nov 2020 05:24:33 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 28 Nov 2020 11:24:04 +0100 Message-Id: <20201128102409.3157-1-ludo@gnu.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201127083302.2578-1-ludo@gnu.org> References: <20201127083302.2578-1-ludo@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 Hi! This new version addresses the shortcomings I mentioned earlier and other issues reported on IRC: • ld.so no longer uses “../etc/ld.so.cache”. Instead, it (1) ensures $ORIGIN is in the store, (2) extracts the store file name, and (3) appends “/etc/ld.so.cache”. IOW, the ‘ld.so.cache’ is always resolved relative to the store directory $ORIGIN belongs to, not relative to $ORIGIN itself. Thinking about it, it’s a direct translation of the ld.so.cache model from FHS to the functional model where a system-wide /etc/ld.so.cache makes no sense. • ‘make-dynamic-linker-cache’ now creates an ‘ld.so.conf’ that contains all the dependencies, recursively, as would be returned by ‘ldd’. The new ‘file-needed/recursive’ procedure returns the list of shared objects depended on like ‘ldd’. • ‘make-dynamic-linker-cache’ creates ‘ld.so.conf’ in $TMPDIR rather than hard-code /tmp, so as to be friendlier to ‘--disable-chroot’ builds (as is currently used on GNU/Hurd). I’m rather happy and confident with that version. :-) Feedback welcome! Ludo’. Ludovic Courtès (4): gremlin: Fix typo in docstring. gremlin: Add 'file-needed/recursive'. gnu: glibc: Load 'etc/ld.so.cache' in $ORIGIN's store item when available. build-system/gnu: Add 'make-dynamic-linker-cache' phase. gnu/local.mk | 1 + gnu/packages/base.scm | 16 +-- gnu/packages/patches/glibc-dl-cache.patch | 140 ++++++++++++++++++++++ guix/build-system/gnu.scm | 4 + guix/build/gnu-build-system.scm | 68 +++++++++++ guix/build/gremlin.scm | 43 ++++++- tests/gremlin.scm | 36 ++++++ 7 files changed, 297 insertions(+), 11 deletions(-) create mode 100644 gnu/packages/patches/glibc-dl-cache.patch