RFR: 8349178: runtime/jni/atExit/TestAtExit.java should be supported on static JDK

Jiangli Zhou jiangli at openjdk.org
Tue Feb 4 19:45:20 UTC 2025


On Tue, 4 Feb 2025 19:04:22 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> A static build isn't really suitable for custom launchers (or anything that embeds a VM).

Just want to provide some relevant data point. We build custom launcher and statically link with the libjvm (for hermetic case). If libjvm is statically linked with the launcher, then there's actually no need to change the direct calls to those JNI_ functions. The direct calls are not problematic on static build. 

> An alternative is to have the tests that use JNI_CreateJavaVM to not be selected. 

The alternative also sounds reasonable to me. We could skip running on static JDK if a test explicitly requires libjvm.so, libjava.so, etc at runtime, at least initially.

> At some point I suspect we'll need to add a property to jtreg-ext/requires/VMProps.java for these builds anyway.

That's a good point. We can add a `vm.static.jdk` to help test selection.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23431#issuecomment-2634906630


More information about the build-dev mailing list