Subject: pkg/36090: run-time library path checking broken when building/installing with DESTDIR
To: None <email@example.com, firstname.lastname@example.org,>
From: None <email@example.com>
Date: 03/26/2007 19:55:00
>Synopsis: run-time library path checking broken when building/installing with DESTDIR
>Arrival-Date: Mon Mar 26 19:55:00 +0000 2007
>Originator: Blair Sadewitz
>Release: 4.99.16 on i386 and amd64
NetBSD dexamyl 4.99.16 NetBSD 4.99.16 (DEXAMYL) #2: Sat Mar 24 23:20:41 EDT 2007
The latest commit to mk/check/check-shlibs.mk removed the leading / from
line 32. This results in checking library paths against absolute pathnames in DESTDIR, e.g.:
pkg_info: can't find package `lua-5.1.1nb1'
=> Checking for missing run-time search paths in lua-5.1.1nb1
ERROR: /usr/pkgsrc/lang/lua/work.dexamyl/.destdir/usr/pkg/bin/lua: -llua.5
=> not found
ERROR: *** The programs/libs shown above will not find the listed
ERROR: shared libraries at runtime.
ERROR: Please fix the package (add -Wl,-R.../lib in the right places)!
*** Error code 1
Upon discussion of this issue with Klaus Heinz, it seems that this change--which is a fix--uncovered a bigger problem: it is possible that prior to this change, no libraries were checked when using relative pathnames.
Using DESTDIR support, Try to create a package which installs a shared library.
Find a platform-independent way of doing something like extracting DT_RPATH from ELF binaries to construct LD_LIBRARY_PATH, then use this in mk/check/check-shlibs.mk.
This problem does not apply unless one is using DESTDIR support.