[jdk17] RFR: 8269668: [aarch64] java.library.path not including /usr/lib64
Andrew Haley
aph at openjdk.java.net
Fri Jul 2 12:34:59 UTC 2021
On Fri, 2 Jul 2021 08:06:07 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> This fix simplifies the `if` condition to use a default 64-bit library path including default setting when `_LP64` is defined (os has 64-bitness). This should be safe IMHO and seems better than explicitly enumerating all 64 bit Linux architectures.
>
> This issue affects older releases and I'd like to get this fix into JDK 17. Thoughts?
> Considering a platform that has a 64-bit library `foo` in `/lib` (over `/lib64`), then a call to `System.loadLibrary("foo")` would continue to work (as this patch just adds more default paths). It would only break on those systems that have `/lib64/libfoo.so` _and_ `/lib/libfoo.so` where the former is actually different. I wonder how likely this is. For ppc64, s390x, amd64 we already have the 64-bit including default paths. In addition, since JDK-8214332 - JDK 12 -, there is `--with-jni-libpath` configure option to override all that.
>
> All things considered, the post-patch fallback default library path seems reasonable.
Make it `/lib:/lib64` for backports and you don't have to worry about that possibility.
All this nonsense could be avoided if we used ldconfig rather than hard-coded strings, but we are where we are.
-------------
PR: https://git.openjdk.java.net/jdk17/pull/200
More information about the hotspot-runtime-dev
mailing list