nut-scanner can't load /usr/lib64/libusb-1.0.so Reproducible: Always Steps to Reproduce: 1. install sys-power/nut-2.8.0-r2 2. run nut-scanner Actual Results: Cannot load USB library (/usr/lib64/libusb-1.0.so) : file not found. USB search disabled. Expected Results: Successful Scanning USB bus. Found: # cat /usr/lib64/libusb-1.0.so /* GNU ld script Since Gentoo has critical dynamic libraries in /lib, and the static versions in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we run into linking problems. This "fake" dynamic lib is a linker script that redirects the linker to the real lib. And yes, this works in the cross- compiling scenario as the sysroot-ed linker will prepend the real path. See bug https://bugs.gentoo.org/4411 for more info. */ GROUP ( /lib64/libusb-1.0.so.0 ) I made symlink to ln -s /lib64/libusb-1.0.so.0 /usr/lib64/libusb-1.0.so Now scan is successful but don't know is any side effects occurs.
Is it trying to dlopen() libusb?
Looks like it tries to dlopen "libusb-1.0.so" instead of using the proper soname "libusb-1.0.so.0". https://github.com/networkupstools/nut/blob/v2.8.0/tools/nut-scanner/nutscan-init.c#L136