On Mon, 3 Mar 2025 17:36:00 GMT, Jiangli Zhou <jian...@openjdk.org> wrote:

>> Please review the test fix that removes `libVThreadEventTest` explicit 
>> dependency to `libjvm`, by removing the call to `JNI_GetCreatedJavaVMs` in 
>> `Agent_OnAttach`. There is a `vm` argument passed via `Agent_OnAttach`. With 
>> the change, `libVThreadEventTest` no longer needs to be linked with 
>> `libjvm.so` (or `jvm.dll`). `VThreadEventTest.java` now runs on both dynamic 
>> and static JDK.
>> 
>> Tested on static JDK locally
>> GHA: 
>> https://github.com/jianglizhou/jdk/actions/runs/13577993687/job/37960245161
>
> Thanks for the reviews and historical info!

> @jianglizhou I looked at this as part of my backlog, and it struck me that 
> there are several other tests that declare a dependency to java.base:libjvm. 
> Are these working properly on static builds?

Except `BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libnativeStack`, the other 
remaining ones in 
[JtregNativeJdk.gmk](https://github.com/openjdk/jdk/blob/5cd4fe63768715ec7be32e248e05e611ea9b557d/make/test/JtregNativeJdk.gmk#L56),
  
[JtregNativeLibTest.gmk](https://github.com/openjdk/jdk/blob/5cd4fe63768715ec7be32e248e05e611ea9b557d/make/test/JtregNativeLibTest.gmk#L48)
 and 
[JtregNativeHotspot.gmk](https://github.com/openjdk/jdk/blob/5cd4fe63768715ec7be32e248e05e611ea9b557d/make/test/JtregNativeHotspot.gmk#L858)
 with `java.base:libjvm` dependency are for building test `exe`. We could skip 
those tests on static JDK until we figure out how we want to support multiple 
executables. 

`BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libnativeStack` adds `java.base:libjvm` 
dependency on Windows only. It might not be needed.

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

PR Comment: https://git.openjdk.org/jdk/pull/23835#issuecomment-2707127984

Reply via email to