Date: Thu, 14 Nov 2019 21:30:28 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: mike tancsa <mike@sentex.net> Cc: FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org> Subject: Re: lib not found and found at the same time ? Message-ID: <20191114193028.GC2707@kib.kiev.ua> In-Reply-To: <dffb82c8-f9c6-78bd-5323-e58e80ac5c50@sentex.net> References: <a0d92250-b0dc-8cbb-4817-a88abece4110@sentex.net> <20191113222525.GW2707@kib.kiev.ua> <dffb82c8-f9c6-78bd-5323-e58e80ac5c50@sentex.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 14, 2019 at 08:46:13AM -0500, mike tancsa wrote: > > On 11/13/2019 5:25 PM, Konstantin Belousov wrote: > > On Wed, Nov 13, 2019 at 04:48:40PM -0500, mike tancsa wrote: > >> I was trying to upgrade (failed) and then re-install the > >> samba410-4.10.10 port on a RELENG12 box. One of the Samba libs shows > >> some output I dont understand on ldd > >> > >> ldd /usr/local/lib/nss_wins.so.1 > >> /usr/local/lib/nss_wins.so.1: > >> libwbclient.so.0 => /usr/local/lib/samba4/libwbclient.so.0 > >> (0x801003000) > >> libwinbind-client-samba4.so => not found (0) > >> libreplace-samba4.so => not found (0) > >> libcrypt.so.5 => /lib/libcrypt.so.5 (0x80066b000) > >> libc.so.7 => /lib/libc.so.7 (0x80024a000) > >> libwinbind-client-samba4.so => > >> /usr/local/lib/samba4/private/libwinbind-client-samba4.so (0x801213000) > >> libreplace-samba4.so => > >> /usr/local/lib/samba4/private/libreplace-samba4.so (0x801417000) > >> > >> > >> There are 2 libs it says it cannot find, but then a few lines below it > >> says it found them ? > > First instance (not found) is probably the direct dependency, which is > > probably not found because nss_wins.so does not have rpath recorded. > > Then, I guess, some other library also depends on libwinbind-client-samba4.so, > > but this library has rpath. > > > > You can check this with readelf, look for DT_NEEDED and DT_RPATH* > > dynamic entries. > > Thanks! > > readelf -d nss_wins.so.1 > > Dynamic section at offset 0x1d20 contains 32 entries: > Tag Type Name/Value > 0x0000000000000001 NEEDED Shared library: [libwbclient.so.0] > 0x0000000000000001 NEEDED Shared library: > [libwinbind-client-samba4.so] > 0x0000000000000001 NEEDED Shared library: > [libreplace-samba4.so] > 0x0000000000000001 NEEDED Shared library: [libcrypt.so.5] > 0x0000000000000001 NEEDED Shared library: [libc.so.7] > 0x000000000000000e SONAME Library soname: [nss_wins.so.1] > 0x000000000000000f RPATH Library rpath: [/usr/local/lib] > 0x000000000000001d RUNPATH Library runpath: [/usr/local/lib] > > Looking at other libs, they have the settings > > 0x000000000000000f RPATH Library rpath: > [/usr/local/lib/samba4/private:/usr/local/lib] > 0x000000000000001d RUNPATH Library runpath: > [/usr/local/lib/samba4/private:/usr/local/lib] > > What is the best way to fix this ? It seems I can do a quick libmap > entry and it seems to correct it > > > [/usr/local/lib/nss_wins.so.1] > libwinbind-client-samba4.so > /usr/local/lib/samba4/private/libwinbind-client-samba4.so > libreplace-samba4.so /usr/local/lib/samba4/private/libreplace-samba4.so > > ldd nss_wins.so.1 > nss_wins.so.1: > libwbclient.so.0 => /usr/local/lib/samba4/libwbclient.so.0 > (0x801003000) > libwinbind-client-samba4.so => > /usr/local/lib/samba4/private/libwinbind-client-samba4.so (0x801213000) > libreplace-samba4.so => > /usr/local/lib/samba4/private/libreplace-samba4.so (0x801417000) > libcrypt.so.5 => /lib/libcrypt.so.5 (0x80066b000) > libc.so.7 => /lib/libc.so.7 (0x80024a000) > > This is something that needs to be fixed in the port at build time ? Why is it a problem ? If the library is loaded from a binary that already linked to the depended lib it would just work. Otherwise yes, it is the ports' build issue, it must not be papered over with libmap or LD_LIBRARY_PATH.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191114193028.GC2707>