From unknown Fri Jun 20 07:24:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26048: Use absolute file names in NEED instead of adding many entries to RUNPATH Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 10 Mar 2017 15:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26048 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 26048@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14891580854241 (code B ref -1); Fri, 10 Mar 2017 15:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Mar 2017 15:01:25 +0000 Received: from localhost ([127.0.0.1]:49832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmM2l-00016J-Gi for submit@debbugs.gnu.org; Fri, 10 Mar 2017 10:01:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmM2k-000168-C5 for submit@debbugs.gnu.org; Fri, 10 Mar 2017 10:01:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmM2Z-0000Ho-HU for submit@debbugs.gnu.org; Fri, 10 Mar 2017 10:01:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cmM2Z-0000Hk-F3 for submit@debbugs.gnu.org; Fri, 10 Mar 2017 10:01:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmM2Y-0000rQ-2h for bug-guix@gnu.org; Fri, 10 Mar 2017 10:01:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmM2V-0000Go-I0 for bug-guix@gnu.org; Fri, 10 Mar 2017 10:01:10 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmM2V-0000Gk-FZ for bug-guix@gnu.org; Fri, 10 Mar 2017 10:01:07 -0500 Received: from [193.50.110.248] (port=42816 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cmM2U-0006DB-RN for bug-guix@gnu.org; Fri, 10 Mar 2017 10:01:07 -0500 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 =?UTF-8?Q?Vent=C3=B4se?= an 225 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Fri, 10 Mar 2017 16:01:04 +0100 Message-ID: <87zigt89cf.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello! As Andy just noted on IRC, shared library lookup is inefficient in Guix, because there=E2=80=99s one entry per library in RUNPATH. So we get: --8<---------------cut here---------------start------------->8--- open("/gnu/store/y8ppqsxiki39n4mqpb4mab6bgwqsnnp7-libgc-7.4.2/lib/libm.so.6= ", O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) open("/gnu/store/w0bkj9qh7iqcklm5ld8ghg1ynnzqyv00-libffi-3.2.1/lib/libm.so.= 6", O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) open("/gnu/store/d5gw4i6bnyznmbr55ba39bl3pgrhsyp0-libunistring-0.9.6/lib/li= bm.so.6", O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) open("/gnu/store/6k08nkddnrb15h5pwp1s0fa94mr1qas9-gmp-6.1.1/lib/libm.so.6",= O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) open("/gnu/store/9yn89bkl8vcg5rh9dmw3jijciwgrwjls-libltdl-2.4.6/lib/libm.so= .6", O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) open("/gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/lib/libm.so.6"= , O_RDONLY|O_CLOEXEC) =3D 3 --8<---------------cut here---------------end--------------->8--- An alternate approach would be for ld-wrapper to replace =E2=80=9C-lfoo=E2= =80=9D with =E2=80=9C/gnu/store/=E2=80=A6/libfoo.so=E2=80=9D, which would add the absol= ute file name as NEEDed in the ELF file. Ludo=E2=80=99. From unknown Fri Jun 20 07:24:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26048: =?UTF-8?Q?=E2=80=98core-updates=E2=80=99?= is back! Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 05 Sep 2017 14:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26048 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ricardo Wurmus Cc: Andy Wingo , guix-devel , 26048@debbugs.gnu.org Received: via spool by 26048-submit@debbugs.gnu.org id=B26048.150462347616463 (code B ref 26048); Tue, 05 Sep 2017 14:58:02 +0000 Received: (at 26048) by debbugs.gnu.org; 5 Sep 2017 14:57:56 +0000 Received: from localhost ([127.0.0.1]:51545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpFIa-0004HT-1K for submit@debbugs.gnu.org; Tue, 05 Sep 2017 10:57:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpFIY-0004HE-3C for 26048@debbugs.gnu.org; Tue, 05 Sep 2017 10:57:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpFIN-0006Cx-Lc for 26048@debbugs.gnu.org; Tue, 05 Sep 2017 10:57:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpFIN-0006Co-IP; Tue, 05 Sep 2017 10:57:43 -0400 Received: from [193.50.110.184] (port=43006 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dpFIN-0001cw-4P; Tue, 05 Sep 2017 10:57:43 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <878ti3uzaz.fsf@gnu.org> <87val6zqg0.fsf@igalia.com> <87lgm14btg.fsf@gnu.org> <87h8whuvpx.fsf@elephly.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 19 Fructidor an 225 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Tue, 05 Sep 2017 16:57:40 +0200 In-Reply-To: <87h8whuvpx.fsf@elephly.net> (Ricardo Wurmus's message of "Tue, 05 Sep 2017 15:21:46 +0200") Message-ID: <87zia9p50b.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Ricardo Wurmus skribis: > Andy wrote: > >> It would be pretty cool if we could fix our O(n^2) problems in search >> paths in this core-updates -- basically whenever you go to create an >> environment, instead of making e.g. VAR=3DA:B:C:..., for all VARs >> (LIBRARY_PATH, PKG_CONFIG_PATH, etc), instead we make a union directory >> Z containing the union of A, B, C, etc and set VAR=3DZ. The goal would = be >> to fix quadratic run-time lookup costs by replacing it with a >> compile-time computation. This applies to many lookups: PATH, -rpath, >> etc. > > Ludo wrote: > >> A possible alternative solution for ld.so is at >> . > > Do you know of any negative side effects this would have? For example, > would it not become impossible to override libraries at runtime with > LD_LIBRARY_PATH or LD_PRELOAD when =E2=80=9C-lfoo=E2=80=9D is replaced by= the absolute > file name of the =E2=80=9Cfoo=E2=80=9D library? Good question. Per the ELF v1.2 spec=C2=B9 (page 82), setting DT_NEEDED to an absolute file name would prevent overriding via LD_LIBRARY_PATH, which is not desirable. It turns out we cannot even set DT_NEEDED to an absolute file name in the first place, because ld records the DT_SONAME of the library, when it=E2=80=99s available (which is the case most of the time), rather than its file name. IOW, the approach suggested in isn=E2=80=99t r= eally applicable. :-/ Ludo=E2=80=99. =C2=B9 http://refspecs.linuxbase.org/elf/elf.pdf From unknown Fri Jun 20 07:24:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26048: Use absolute file names in NEED instead of adding many entries to RUNPATH Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 21 Nov 2017 13:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26048 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 26048@debbugs.gnu.org Received: via spool by 26048-submit@debbugs.gnu.org id=B26048.151127134316022 (code B ref 26048); Tue, 21 Nov 2017 13:36:01 +0000 Received: (at 26048) by debbugs.gnu.org; 21 Nov 2017 13:35:43 +0000 Received: from localhost ([127.0.0.1]:50073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eH8iF-0004AM-4g for submit@debbugs.gnu.org; Tue, 21 Nov 2017 08:35:43 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:57762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eH8iD-0004AE-Qc for 26048@debbugs.gnu.org; Tue, 21 Nov 2017 08:35:42 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8A02CFE67 for <26048@debbugs.gnu.org>; Tue, 21 Nov 2017 14:35:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lipcuH2Mnkd8 for <26048@debbugs.gnu.org>; Tue, 21 Nov 2017 14:35:41 +0100 (CET) Received: from ribbon (unknown [193.50.110.188]) by hera.aquilenet.fr (Postfix) with ESMTPSA id CE1A4FE57 for <26048@debbugs.gnu.org>; Tue, 21 Nov 2017 14:35:41 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87zigt89cf.fsf@gnu.org> Date: Tue, 21 Nov 2017 14:35:39 +0100 In-Reply-To: <87zigt89cf.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 10 Mar 2017 16:01:04 +0100") Message-ID: <871skrn49g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > As Andy just noted on IRC, shared library lookup is inefficient in Guix, > because there=E2=80=99s one entry per library in RUNPATH. So we get: > > open("/gnu/store/y8ppqsxiki39n4mqpb4mab6bgwqsnnp7-libgc-7.4.2/lib/libm.so= .6", O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) > open("/gnu/store/w0bkj9qh7iqcklm5ld8ghg1ynnzqyv00-libffi-3.2.1/lib/libm.s= o.6", O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) > open("/gnu/store/d5gw4i6bnyznmbr55ba39bl3pgrhsyp0-libunistring-0.9.6/lib/= libm.so.6", O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) > open("/gnu/store/6k08nkddnrb15h5pwp1s0fa94mr1qas9-gmp-6.1.1/lib/libm.so.6= ", O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) > open("/gnu/store/9yn89bkl8vcg5rh9dmw3jijciwgrwjls-libltdl-2.4.6/lib/libm.= so.6", O_RDONLY|O_CLOEXEC) =3D -1 ENOENT (No such file or directory) > open("/gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/lib/libm.so.= 6", O_RDONLY|O_CLOEXEC) =3D 3 > > An alternate approach would be for ld-wrapper to replace =E2=80=9C-lfoo= =E2=80=9D with > =E2=80=9C/gnu/store/=E2=80=A6/libfoo.so=E2=80=9D, which would add the abs= olute file name as > NEEDed in the ELF file. This is actually impossible, as discussed at : Per the ELF v1.2 spec=C2=B9 (page 82), setting DT_NEEDED to an absolute file name would prevent overriding via LD_LIBRARY_PATH, which is not desirable. It turns out we cannot even set DT_NEEDED to an absolute file name in the first place, because ld records the DT_SONAME of the library, when it=E2=80=99s available (which is the case most of the time), rather than = its file name. =C2=B9 http://refspecs.linuxbase.org/elf/elf.pdf Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 21 08:35:50 2017 Received: (at control) by debbugs.gnu.org; 21 Nov 2017 13:35:50 +0000 Received: from localhost ([127.0.0.1]:50079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eH8iM-0004At-De for submit@debbugs.gnu.org; Tue, 21 Nov 2017 08:35:50 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:57765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eH8iL-0004Am-2P for control@debbugs.gnu.org; Tue, 21 Nov 2017 08:35:49 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id DBD81FE67 for ; Tue, 21 Nov 2017 14:35:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uOpFvcB3wGwI for ; Tue, 21 Nov 2017 14:35:50 +0100 (CET) Received: from ribbon (unknown [193.50.110.188]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 5F696FE57 for ; Tue, 21 Nov 2017 14:35:50 +0100 (CET) Date: Tue, 21 Nov 2017 14:35:47 +0100 Message-Id: <87zi7flpos.fsf@gnu.org> To: control@debbugs.gnu.org From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: control message for bug #26048 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 26048 wontfix close 26048