configuring with --with-jvm-variants=minimal,server makes cds disappear in server
Ioi Lam
ioi.lam at oracle.com
Thu Jan 16 18:48:38 UTC 2020
On 1/16/20 9:09 AM, Erik Joelsson wrote:
> I would lean towards changing the check from "if any of the variants
> do not support CDS, disable it" to "if any of the variants support
> CDS, enable it". The cds jvm feature is only added to the variants
> that support it anyway.
>
> If you do this, you probably need to figure out how to explicitly only
> generate the archive for the supported jvm variants in Images.gmk too.
> Not sure if the archive is jvm variant dependent or if the layout even
> supports multiple variants. It will likely get messy.
The CDS archive is dependent on the exact libjvm.so, so each JDK image
should creates its own CDS archive during the build.
I think this can be handled emitting a different value for
"BUILD_CDS_ARCHIVE" in the spec.gmk of each variant.
Thanks
- Ioi
>
> /Erik
>
> On 2020-01-16 08:22, Baesken, Matthias wrote:
>> Hello, thanks for looking into it .
>> Should I do a check just looking into single JVM configs, something like
>>
>> AC_DEFUN([HOTSPOT_IS_JVM_VARIANT],
>> [ [ [[ " $JVM_VARIANTS " == " $1 " ]] ] ])
>>
>> if HOTSPOT_IS_JVM_VARIANT(zero) || HOTSPOT_IS_JVM_VARIANT(minimal) ||
>> HOTSPOT_IS_JVM_VARIANT(core); then
>>
>> instead of
>>
>> AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
>> [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
>>
>> if HOTSPOT_CHECK_JVM_VARIANT(zero) ||
>> HOTSPOT_CHECK_JVM_VARIANT(minimal) ||
>> HOTSPOT_CHECK_JVM_VARIANT(core); then
>>
>>
>> This should remove the error in case of multi-JVM configs .
>> Or maybe the whole check ( if HOTSPOT_CHECK_JVM_VARIANT(zero) ||
>> HOTSPOT_CHECK_JVM_VARIANT(minimal) ||
>> HOTSPOT_CHECK_JVM_VARIANT(core); then .... fi )
>> might be removed , I see not so much value in it because in case
>> one sets --enable-jvm-features directly the check isn’t done .
>>
>> I opened bug :
>>
>> https://bugs.openjdk.java.net/browse/JDK-8237374
>>
>> JDK-8237374 : configuring with --with-jvm-variants=minimal,server
>> makes cds disappear in server
>>
>>
>> Best regards, Matthias
>>
>>
>>
>>
>>> This does indeed look like a bug to me. At least at Oracle, we no
>>> longer
>>> build any multi JVM configs regularly, so things like this falls
>>> through
>>> the cracks.
>>>
>>> /Erik
>>>
>>> On 2020-01-16 02:18, Baesken, Matthias wrote:
>>>> Hello, I noticed the following strange "feature" (or is it a bug?) .
>>>> When building 2 VM variants in one build and using
>>>>
>>>> --with-jvm-variants=minimal,server
>>>>
>>>> For this, the build works nicely. But I notice that in the server
>>>> VM, cds is
>>> removed.
>>>> Instead of
>>>>
>>>> checking if cds should be enabled... yes
>>>>
>>>> I get ( with the following patch that adds tracing) :
>>>>
>>>> configure: WARNING: ENABLE_CDS set to false because we found a
>>> minimal, core or zero JVM.
>>>> checking if cds should be enabled... no
>>>> ...
>>>>
>>>> * JVM features: minimal: 'compiler1 minimal serialgc'
>>>> server: 'compiler1
>>> compiler2 epsilongc g1gc jfr jni-check jvmti management nmt parallelgc
>>> serialgc services vm-structs'
>>>> (patch is
>>>>
>>>> --- a/make/autoconf/hotspot.m4 Wed Jan 15 21:20:40 2020 -0800
>>>> +++ b/make/autoconf/hotspot.m4 Thu Jan 16 10:24:43 2020 +0100
>>>> @@ -528,6 +528,7 @@
>>>> if HOTSPOT_CHECK_JVM_VARIANT(zero) ||
>>> HOTSPOT_CHECK_JVM_VARIANT(minimal) ||
>>> HOTSPOT_CHECK_JVM_VARIANT(core); then
>>>> # ..except when the user explicitely requested it with
>>>> --enable-jvm-
>>> features
>>>> if ! HOTSPOT_CHECK_JVM_FEATURE(cds); then
>>>> ENABLE_CDS="false"
>>>> + AC_MSG_WARN([ENABLE_CDS set to false because we found a
>>> minimal, core or zero JVM.])
>>>> if test "x$enable_cds" = "xyes"; then
>>>> AC_MSG_ERROR([CDS not implemented for variants zero,
>>>> minimal,
>>> core. Remove --enable-cds.])
>>>> Fi
>>>>
>>>>
>>>> Is it expected that cds goes away in "server" when configuring
>>>> "--with-
>>> jvm-variants=minimal,server" ? Looks like a bug to me, should it
>>> be fixed
>>> (so that cds stays in the server jvm-feature list) ?
>>>>
>>>> Thanks, Matthias
>>>>
More information about the build-dev
mailing list