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

Magnus Ihse Bursie ihse at openjdk.org
Thu Feb 27 15:10:00 UTC 2025


On Thu, 27 Feb 2025 06:53:26 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> make/hotspot/lib/JvmFeatures.gmk line 36:
>> 
>>> 34: ################################################################################
>>> 35: 
>>> 36: JVM_CFLAGS_FEATURES += -DJVM_VARIANT=\"$(JVM_VARIANT)\"
>> 
>> Might it be a better idea to set -DJVM_VARIANT as the CXXFLAGS for cdsConfig.cpp directly instead?
>
> 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.

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

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


More information about the hotspot-runtime-dev mailing list