From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#20102: Problem with ld.so RUNPATH on armhf Date: Sun, 14 Jun 2015 01:36:00 +0200 Message-ID: <87twub89lr.fsf@gnu.org> References: <87y4n0ybdd.fsf@netris.org> <87bngjk5g2.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3uz4-0003iA-Ni for bug-guix@gnu.org; Sat, 13 Jun 2015 19:37:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3uz0-0001H2-Mp for bug-guix@gnu.org; Sat, 13 Jun 2015 19:37:06 -0400 Received: from debbugs.gnu.org ([140.186.70.43]:38590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3uz0-0001Gy-Jn for bug-guix@gnu.org; Sat, 13 Jun 2015 19:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z3uz0-0005Im-B8 for bug-guix@gnu.org; Sat, 13 Jun 2015 19:37:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87bngjk5g2.fsf@netris.org> (Mark H. Weaver's message of "Sat, 13 Jun 2015 11:12:45 -0400") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Mark H Weaver Cc: 20102@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mark H Weaver skribis: > In March 2015, Mark H Weaver wrote: [...] >> Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynami= c_info: Assertion `info[29] =3D=3D ((void *)0)' failed! > > The same problem has resurfaced on armhf on the current core-updates > branch. More precisely, this is a merge of core-updates (16cae79), > master (1e44cf8), and openssl-update (0515580). > > There's one difference: I can successfully run "guix build -K > glibc-utf8-locales", but if I try to build any profile, it fails while > building another package named "glibc-utf8-locales", with precisely the > same error message above. Otherwise, I managed to build every package > in my profile, which includes some substantial software. It happens on x86_64 as well. Namely, the glibc that is built with glibc-final and gcc-final has extra RUNPATH entries: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix build -e '(@ (gnu packages base) glibc)' -K [...] /gnu/store/pxi61vv6qj325y3zs5qpcy2shykgxdar-glibc-2.21 /gnu/store/m3qidd4gx7ry3wxagsrd9cwlykq90yi7-glibc-2.21-debug $ /gnu/store/pxi61vv6qj325y3zs5qpcy2shykgxdar-glibc-2.21/bin/gencat=20 Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynamic_i= nfo: Assertion `info[29] =3D=3D ((void *)0)' failed! $ objdump -x /gnu/store/pxi61vv6qj325y3zs5qpcy2shykgxdar-glibc-2.21/bin/gen= cat |grep PATH RUNPATH /gnu/store/2bq2qaaajar2f3dbxrrwssxfrfi0k9zr-gcc-4.9.= 2/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2 --8<---------------cut here---------------end--------------->8--- After a bit of investigation, I found that the problem came from: -plugin /gnu/store/2bq2qaaajar2f3dbxrrwssxfrfi0k9zr-gcc-4.9.2/libexec/gcc= /x86_64-unknown-linux-gnu/4.9.2/liblto_plugin.so.0 which led ld-wrapper to add a -rpath flag for that directory. I=E2=80=99m testing the patch below and will commit tomorrow if everything = goes well. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- a/gnu/packages/ld-wrapper.in +++ b/gnu/packages/ld-wrapper.in @@ -143,12 +143,16 @@ exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)) (define path+files+args (fold (lambda (argument result) (match result - ((library-path library-files ("-dynamic-linker" . rest)) - ;; When passed '-dynamic-linker ld.so', ignore 'ld.so'. - ;; See . + ((library-path library-files + ((and flag + (or "-dynamic-linker" "-plugin")) + . rest)) + ;; When passed '-dynamic-linker ld.so', ignore 'ld.so'; when + ;; passed '-plugin liblto_plugin.so', ignore + ;; 'liblto_plugin.so'. See . (list library-path library-files - (cons* argument "-dynamic-linker" rest))) + (cons* argument flag rest))) ((library-path library-files previous-args) (cond ((string-prefix? "-L" argument) ;augment the search path (list (append library-path --=-=-=--