The default java.library.path on Linux does not include the library paths in the mulitarch-spec
Florian Weimer
fweimer at redhat.com
Mon Jan 8 20:31:14 UTC 2024
* Glavo:
> I wish OpenJDK would parse the /etc/ld.so.conf to get the full library
> path list so it would be consistent with the behavior of ld. Can
> anyone consider this suggestion?
Parsing /etc/ld.so.conf is the wrong approach. Even glibc itself does
not look at that file at run time, it's strictly for ldconfig only.
(/etc/ld.so.cache is not really cache for directories that are not on
the system search path, and only listed in /etc/ld.so.conf.) The
multi-arch patches were never upstreamed into the GNU toolchain
(although sometimes it's just a matter of automated setting the
defaults).
Apparently, Debian has decided that the multi-arch path should be
/usr/lib/…/jni (where … gets replaced with the multi-arch directory
name). That's probably a downstream-only patch, too.
The system paths can in theory be queried using dlinfo and
RTLD_DI_SERINFO, but I'm not sure if it will deliver the expected
results without proper multi-arch integration for the toolchain.
Thanks,
Florian
More information about the core-libs-dev
mailing list