unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: 20102@debbugs.gnu.org
Subject: bug#20102: Problem with ld.so RUNPATH on armhf
Date: Wed, 08 Apr 2015 11:52:30 +0200	[thread overview]
Message-ID: <87fv8b0wwx.fsf@gnu.org> (raw)
In-Reply-To: <87d23hynqe.fsf@netris.org> (Mark H. Weaver's message of "Mon, 06 Apr 2015 17:02:17 -0400")

Mark H Weaver <mhw@netris.org> skribis:

> *lib:
> %{!mandroid|tno-android-ld:-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static:-rpath=/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}};:-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static:-rpath=/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}} %{!static: -ldl}}

On x86_64 I have pretty much the same:

--8<---------------cut here---------------start------------->8---
*lib:
%{!mandroid|tno-android-ld:-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib %{!static:-rpath=/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}};:-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib %{!static:-rpath=/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}} %{!static: -ldl}}
--8<---------------cut here---------------end--------------->8---

‘link_command’ is also identical.

The difference between ‘glibc-final’ and (@ (gnu packages base) glibc)
(used to build glibc-utf8-locales) is that the latter is built with
‘gcc-final’, and ‘gcc-final’ always passes “-rpath $libc/lib” when
linking a shared object, as seen above.

However, when linking ld.so, -nostdlib is used, so IIUC the “lib” spec
is ignored, so the -rpath flag isn’t passed.

At least that’s what happens on x86_64: I interrupted the (@ (gnu
packages base) glibc) build on x86_64 and ran the command manually:

--8<---------------cut here---------------start------------->8---
ludo@pluto /tmp/nix-build-glibc-2.21.drv-0/build/elf$ strace -s 345 -f -o ,,s gcc --verbose   -nostdlib -nostartfiles -shared -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new		\
	  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs 	\
	  /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os -Wl,--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map		\
	  -Wl,-soname=ld-linux-x86-64.so.2			\
	  -Wl,-defsym=_begin=0

> > > > Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: 
Thread model: posix
gcc version 4.8.4 (GCC) 
COMPILER_PATH=/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib/:/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib/:/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib/:/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib/:/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib/:/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib/:/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib/:/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../../:/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib
COLLECT_GCC_OPTIONS='-v' '-nostdlib' '-nostartfiles' '-shared' '-o' '/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new' '-mtune=generic' '-march=x86-64'
 /gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/collect2 --eh-frame-hdr -m elf_x86_64 -shared -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new -L/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib -L/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib -L/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib -L/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib -L/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib -L/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib -L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib -L/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib -L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4 -L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../.. -L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib -z combreloc -z relro --hash-style=both -z defs /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os --version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map -soname=ld-linux-x86-64.so.2 -defsym=_begin=0
--8<---------------cut here---------------end--------------->8---

The strace log shows that ld is not passed the -rpath flags that appear
in the “lib” spec:

--8<---------------cut here---------------start------------->8---
13261 execve("/gnu/store/crfqrvj1g3ldyhfqq8wpwqx3sd6qn4k7-ld-wrapper-0/bin/ld", ["/gnu/store/crfqrvj1g3ldyhfqq8wpwqx3sd6qn4k7-ld-wrapper-0/bin/ld", "--eh-frame-hdr", "-m", "elf_x86_64", "-shared", "-o", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new", "-L/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib", "-L/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib", "-L/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib", "-L/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib", "-L/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib", "-L/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib", "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib", "-L/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib", "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4", "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../..", "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib", "-z", "combreloc", "-z", "relro", "--hash-style=both", "-z", "defs", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os", "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map", "-soname=ld-linux-x86-64.so.2", "-defsym=_begin=0"], [/* 73 vars */]
--8<---------------cut here---------------end--------------->8---

Could you try the same on armhf?

TIA,
Ludo’.

  reply	other threads:[~2015-04-08  9:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 18:56 bug#20102: Problem with ld.so RUNPATH on armhf Mark H Weaver
2015-04-04 21:58 ` Ludovic Courtès
2015-04-05  4:42   ` Mark H Weaver
2015-04-06 20:24     ` Ludovic Courtès
2015-04-06 21:02       ` Mark H Weaver
2015-04-08  9:52         ` Ludovic Courtès [this message]
2015-04-08 15:21           ` Mark H Weaver
2015-04-08 15:26             ` Mark H Weaver
2015-04-08 15:48               ` Ludovic Courtès
2015-04-08 15:50             ` Mark H Weaver
2015-04-08 18:39             ` Ludovic Courtès
2015-04-08 22:33               ` Ludovic Courtès
2015-04-09  6:04               ` Mark H Weaver
2015-04-09  6:57                 ` Ludovic Courtès
2015-04-09  8:18                 ` Ludovic Courtès
2015-06-13 15:12 ` Mark H Weaver
2015-06-13 23:36   ` Ludovic Courtès
2015-07-14 13:32     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fv8b0wwx.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=20102@debbugs.gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).