Do not symlink missing shared libraries

From FBSD_tips

Jump to: navigation, search

[edit] Rationale

It inevitably happens that for one reason or another a shared library that some program depends on goes missing. In many cases the changes to the library that generated the new version were relatively small and chances are that the new version could satisfy the programs needs. The temptation for the admin is to symlink the old name to the new library, but this is bad as it put symlinks in a non centralized way in the filesystem. Luckily, the freebsd runtime linker provides for a way to fix this. A file is consulted at load time to determine mappings for a file that may be missing or just not preferred to another file.

[edit] Example

/libexec/ld-elf.so.1: Shared object "libpanelw.so.3" not found, required by "finch"

A search revealed that /usr/lib/libpanelw.so.2 existed (this would tend to indicate that the package was built on a future version on the OS, but we'll leave that for now). Adding a line to /etc/libmap.conf like this :

libpanelw.so.3 libpanelw.so.2

Will map calls to libpanelw.so.3 to actually load libpanelw.so.2.

This effect will be system wide however, to limit it to the finch program only put the program's name in square braces like so :

[finch]
libpanelw.so.3 libpanelw.so.2
Personal tools