Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Nov 2023 13:05:41 -0500
From:      "John W. O'Brien" <john_freebsd-ports@radioprosciutto.org>
To:        Tatsuki Makino <tatsuki_makino@hotmail.com>, FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Re: pkg check -B tcpdump: libcap_dns.so.2 not found
Message-ID:  <3f9b8e65-9dbb-40ea-9037-4621de90a727@radioprosciutto.org>
In-Reply-To: <TYZPR01MB5037DADE6ED1463AB408B967FAADA@TYZPR01MB5037.apcprd01.prod.exchangelabs.com>
References:  <bfa2ac70-cb7c-4970-a16e-2a2505d643f7@radioprosciutto.org> <SI2PR01MB5036709BD411E4EFEBBE6151FAAEA@SI2PR01MB5036.apcprd01.prod.exchangelabs.com> <1271b099-2709-4c18-ad3d-d0475ed4c05f@radioprosciutto.org> <TYZPR01MB5037DADE6ED1463AB408B967FAADA@TYZPR01MB5037.apcprd01.prod.exchangelabs.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/11/23 00:51, Tatsuki Makino wrote:
> John W. O'Brien wrote on 2023/11/11 11:25:
>> On 11/10/23 16:26, Tatsuki Makino wrote:
[...]
> I can understand it because it is related to ldconfig up to /usr/local/lib/compat/pkg, but then it jumps to /lib/casper.
> This is due to the following.
> 
> https://cgit.freebsd.org/src/tree/libexec/rtld-elf/paths.h?h=stable/12#n59
> 
> This allows tcpdump to load libcap_dns.so.2.
> However, pkg does not seem to treat that directory as a base library directory.
> 
> It is presumed that the main branch will not have this problem because it has already been moved from /lib/casper to /lib.

"pkg check -B" reads /var/run/ld-elf.so.hints, which is maintained by 
ldconfig. By default, that does not include /lib/casper.


% sudo pkg check -B tcpdump
Checking tcpdump:   0%
(tcpdump-4.99.4_1) /usr/local/sbin/tcpdump - required shared library 
libcap_dns.so.2 not found
Checking tcpdump: 100%
% echo /lib/casper |
     sudo tee /usr/local/libdata/ldconfig/casper > /dev/null
% sudo service ldconfig restart
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib 
/usr/local/lib/compat/pkg /lib/casper /usr/local/lib/compat/pkg 
/usr/local/lib/perl5/5.36/mach/CORE /usr/local/llvm15/lib
32-bit compatibility ldconfig path: /usr/lib32
% sudo pkg check -B tcpdump
Checking tcpdump: 100%


As you pointed out before, rtld does not rely on elf-hints to find 
casper shlibs due to /lib/casper's being hard-coded among the standard 
library paths.

To me, it looks like the bug is in rc.d/ldconfig, where _LCD should 
match what rtld thinks of as the standard library paths.


stable/12

https://cgit.freebsd.org/src/tree/libexec/rtld-elf/paths.h?h=stable/12&id=6a0891c6ebb78bd59a3fc440675e31b6982de896#n59
https://cgit.freebsd.org/src/tree/libexec/rc/rc.d/ldconfig?h=stable/12&id=6a0891c6ebb78bd59a3fc440675e31b6982de896#n26


stable/13

https://cgit.freebsd.org/src/tree/libexec/rtld-elf/rtld_paths.h?h=stable/13&id=a6d08183731b28d1e9c898a0bc8708136776b250#n70
https://cgit.freebsd.org/src/tree/libexec/rc/rc.d/ldconfig?h=stable/13&id=a6d08183731b28d1e9c898a0bc8708136776b250#n25


main does not appear to be affected, as you noted, nor does stable/14.

I will see about submitting a patch.


>> Would freebsd-pkg@ be a better forum for this discussion?
> 
> I do not subscribe, so please take this :)

Neither do I. Maybe next time. :)

All: Thanks for your patience with what turned out to be off-topic for 
ports.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3f9b8e65-9dbb-40ea-9037-4621de90a727>