java.base:libjava is specified as a shared library dependency for some of the JDK jtreg tests. That adds `-ljava` to the linker flag on Linux (for example), when linking the jtreg test native libraries.
Explicitly linking libjava.so adds it as a recorded dependency. That can cause failure when loading the jtreg native library due to missing libjava.so at runtime.
$ ldd ./linux-x86_64-server-release/images/test/jdk/jtreg/native/libNewDirectByteBuffer.so
linux-vdso.so.1 (0x00007fcba8357000)
libjava.so => <snip>
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fcba8000000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcba7f1e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fcba8307000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcba7d35000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcba8359000)
For the following jtreg test native libraries, java.base:libjava is not needed and can be removed:
libNewDirectByteBuffer
libDirectIO
libInheritedChannel
Explicitly linking libjava.so adds it as a recorded dependency. That can cause failure when loading the jtreg native library due to missing libjava.so at runtime.
$ ldd ./linux-x86_64-server-release/images/test/jdk/jtreg/native/libNewDirectByteBuffer.so
linux-vdso.so.1 (0x00007fcba8357000)
libjava.so => <snip>
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fcba8000000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcba7f1e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fcba8307000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcba7d35000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcba8359000)
For the following jtreg test native libraries, java.base:libjava is not needed and can be removed:
libNewDirectByteBuffer
libDirectIO
libInheritedChannel
- relates to
-
JDK-8303796 Optionally build fully statically linked JDK image
-
- Open
-
- links to
-
Commit(master) openjdk/jdk/2eac490b
-
Review(master) openjdk/jdk/23575