RFR: 8348028: Unable to run gtests with CDS enabled [v3]

Ioi Lam iklam at openjdk.org
Thu Feb 27 16:02:32 UTC 2025


On Thu, 27 Feb 2025 15:06:54 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> Currently, os_bsd.cpp also needs the JVM_VARIANT definition. Later, if we fix the `os::jvm_path()` issues, os_windows.cpp, os_linux.cpp and os_aix.cpp also need JVM_VARIANT.
>
> This is completely wrong.
> 
> The JVM_CFLAGS_FEATURES should be used to add feature-specific flags, not like this. If we really did want to add this to the CFLAGS for all Hotspot files, the correct thing to do would be to add it to JVM_CFLAGS in JvmFlags.gmk.
> 
> However, that is not something we want to do. I fully agree with Julian. This is a specific patch needed for one file only, and it should be added just for this particular file. Compare how this is done for e.g. `abstract_vm_version.cpp` in CompileJvm.gmk.

Maybe we can add a new API `const char* Abstract_VM_Version::vm_variant()` that returns the value defined `-DJVM_VARIANT`? Files like os_*cpp and CDS can call this function to get the string such as "server" or "client".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23758#discussion_r1973885839


More information about the hotspot-runtime-dev mailing list