Hi,

After reading http://lists.gnu.org/archive/html/bug-hurd/2011-08/msg00047.html
I was under the impression that $ORIGIN in -rpath arguments passed to the
linker would have the same effect under Hurd as on Linux/glibc. But it does
not work for me.

This is on Hurd 0.9 (using the image from
https://people.debian.org/~sthibault/hurd-i386/debian-hurd-20170115.img.gz ).

How to reproduce:

$ wget https://haible.de/bruno/gnu/libiconv-20190219.tar.gz
$ tar xfz libiconv-20190219.tar.gz
$ cd libiconv-20190219
$ ./configure --prefix=/tmp/inst1 --enable-relocatable
$ make
$ make install
$ cd /tmp
$ mv inst1 inst2
$ inst2/bin/iconv --help
inst2/bin/iconv: error while loading shared libraries: libiconv.so.2: cannot 
open shared object file: No such file or directory
$ readelf -d inst2/bin/iconv

Dynamic section at offset 0x6404 contains 26 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libiconv.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.0.3]
 0x000000000000001d (RUNPATH)            Library runpath: 
[$ORIGIN/../lib:/tmp/inst1/lib]
...
$ ld --version
GNU ld (GNU Binutils for Debian) 2.27.90.20170114


For comparison, the same procedure works on Linux. There it produces
$ readelf -d inst2/bin/iconv

Dynamic section at offset 0x6e08 contains 26 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libiconv.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000f (RPATH)              Library rpath: 
[$ORIGIN/../lib:/tmp/inst1/lib]
...

Is the difference due to the use of RUNPATH instead of RPATH (must be a
difference in the linker, I guess)? Or is $ORIGIN support in RUNPATH
not meant to work like the the one in RPATH?

Bruno


Reply via email to