On Mon, 30 Jun 2025 14:59:02 +0300
Gleb Popov <[email protected]> wrote:

> On Mon, Jun 30, 2025 at 2:46 PM Tatsuki Makino
> <[email protected]> wrote:
> >
> > Hello.
> >
> > For example, if chromium is having trouble creating new tabs, we can 
> > continue to use it if we have a backup of libxml2.so.2 and a file like 
> > libmap.conf(5) as shown below.
> 
> I think it'd be enough to
> 
> # cp libxml2.so /usr/local/lib/compat/
> 
> instead of dancing with libmap.conf

Do you mean /usr/local/lib/compat/pkg/?

This could be kinda dangerous nowadays.
This is because this directory is NOT the last one in library search
path.

IIRC, when this directory was first introduced (by sysutils/portupgrade,
which is now ports-mgmt/portupgrade, yes, quite an old story), there
were (at least almost) no subdirectories under /usr/local/lib/. 
And /usr/local/lib/compat/pkg/ was clearly the last element in system
wide library search path.

In this case, the directory is looked for only when no matching one
could be found elsewhere. So anything linked against newer libraries are
dynamically linked against newer one sanely, while anything linked
against old version (mis-matched version) keeps on searching and
finally finds one in /usr/local/compat/pkg/.

Nowadays, many library search paths are added after the one for
/usr/local/lib/compat/pkg/ is added by /etc/rc.d/ldconfig
(WRT ldconfig_paths).

Example in my case:
% strings /var/run/ld-elf.so.hints                         
Ehnt
/lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/lib/compat/pkg:/compat/linux/usr/lib64/epsonscan2/libexec:/compat/linux/usr/lib64/epsonscan2/non-free-exec:/usr/local/ffmpeg4/lib:/usr/local/glib-bootstrap/lib:/usr/local/lib/alsa-lib:/usr/local/lib/chaiscript:/usr/local/lib/e2fsprogs:/usr/local/lib/epsonscan2:/usr/local/lib/gcc12:/usr/local/lib/gcc13:/usr/local/lib/heimdal:/usr/local/lib/mysql:/usr/local/lib/opencollada:/usr/local/lib/perl5/5.40/mach/CORE:/usr/local/lib/qt5:/usr/local/lib/qt6:/usr/local/lib/samba4:/usr/local/lib/signon:/usr/local/lib/tddl_emu:/usr/local/llvm14/lib:/usr/local/llvm19/lib:/usr/local/llvm19/lib/x86_64-portbld-freebsd14.3:/usr/local/openjdk11/lib/server:/usr/local/openjdk8/lib/amd64:/usr/local/share/chromium

-- 
Tomoaki AOKI    <[email protected]>

Reply via email to