rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.05k stars 412 forks source link

`configure --prefix` no longer sets RUNPATH as expected #1166

Open slingamn opened 2 years ago

slingamn commented 2 years ago

I'm on Ubuntu 22.04. I'm building libtorrent master (53596afc5fae27) via the following procedure:

  1. mkdir -p ~/sandbox
  2. autoreconf -fi
  3. ./configure --prefix=/home/user/workspace/sandbox
  4. make
  5. make install

then building rtorrent master (1e400144828c9) against it via the following procedure:

  1. export PKG_CONFIG_PATH=/home/user/workspace/sandbox/lib/pkgconfig
  2. autoreconf -fi
  3. ./configure --prefix=/home/user/workspace/sandbox
  4. make
  5. make install

Running objdump -x on the resulting /home/user/workspace/sandbox/bin/rtorrent reveals that it has no defined RUNPATH variable. Accordingly, it is unable to dynamically link against /home/user/workspace/sandbox/lib/libtorrent.so.21 as required. A workaround is to export LD_LIBRARY_PATH=/home/user/workspace/sandbox/lib.

In contrast, when building the version of rtorrent immediately prior to #1102 , i.e. 52ceb39ca38a6, RUNPATH is set as expected:

Dynamic Section:
  NEEDED               libncursesw.so.6
  NEEDED               libtinfo.so.6
  NEEDED               libcurl.so.4
  NEEDED               libtorrent.so.21
  NEEDED               libstdc++.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  RUNPATH              /home/user/workspace/sandbox/lib

so it seems like this was introduced by #1102.

Thanks very much for your time.