all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 20102@debbugs.gnu.org
Subject: bug#20102: Problem with ld.so RUNPATH on armhf
Date: Wed, 08 Apr 2015 11:21:45 -0400	[thread overview]
Message-ID: <87bniyy7au.fsf@netris.org> (raw)
In-Reply-To: <87fv8b0wwx.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 08 Apr 2015 11:52:30 +0200")

ludo@gnu.org (Ludovic Courtès) writes:

> Mark H Weaver <mhw@netris.org> skribis:
>
> 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:
>
> 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
>
> The strace log shows that ld is not passed the -rpath flags that appear
> in the “lib” spec:
>
> 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 */]
>
> Could you try the same on armhf?

I've done so.  Here's the transcript:

--8<---------------cut here---------------start------------->8---
mhw@novena:/tmp/nix-build-glibc-2.21.drv-0$ source environment-variables 
mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build$ cd /tmp/nix-build-glibc-2.21.drv-0/build/elf/
mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$ /usr/bin/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-armhf.so.3			\
	  -Wl,-defsym=_begin=0
> > > > Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/lto-wrapper
Target: armv7l-unknown-linux-gnueabihf
Configured with: 
Thread model: posix
gcc version 4.8.4 (GCC) 
COMPILER_PATH=/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/
LIBRARY_PATH=/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib/:/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib/:/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib/:/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib/:/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib/:/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib/:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/:/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../../:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-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' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'
 /gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/collect2 --eh-frame-hdr -shared -dynamic-linker /gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new -L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib -L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib -L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib -L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib -L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib -L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib -L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib -L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib -L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4 -L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../.. -L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-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-armhf.so.3 -defsym=_begin=0
mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$
--8<---------------cut here---------------end--------------->8---

and here's the corresponding line in the strace log:

--8<---------------cut here---------------start------------->8---
13440 execve("/gnu/store/p70wvylq6xdrlxblnk76k3ljgkrmvpnq-ld-wrapper-0/bin/ld", ["/gnu/store/p70wvylq6xdrlxblnk76k3ljgkrmvpnq-ld-wrapper-0/bin/ld", "--eh-frame-hdr", "-shared", "-dynamic-linker", "/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3", "-X", "-m", "armelf_linux_eabi", "-o", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new", "-L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib", "-L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib", "-L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib", "-L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib", "-L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib", "-L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib", "-L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../..", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-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-armhf.so.3", "-defsym=_begin=0"], [/* 55 vars */] <unfinished ...>
--8<---------------cut here---------------end--------------->8---

    Thanks!
      Mark

  reply	other threads:[~2015-04-08 15:22 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
2015-04-08 15:21           ` Mark H Weaver [this message]
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

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

  git send-email \
    --in-reply-to=87bniyy7au.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=20102@debbugs.gnu.org \
    --cc=ludo@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.